GitLab API - Unable to access file which is within a directory - gitlab

I have a GitLab project which is set up as follows:
myserver.com/SuperGroup/SubGroup/SubGroupProject
The tree of the following project is a top-level txt file and a txt file within a directory. I get the tree from the GitLab API with:
myserver.com/api/v4/projects/1/repository/tree?recursive=true
[{"id":"aba61143388f605d3fe9de9033ecb4575e4d9b69","name":"myDirectory","type":"tree","path":"myDirectory","mode":"040000"},{"id":"0e3a2b246ab92abac101d0eb2e96b57e2d24915d","name":"1stLevelFile.txt","type":"blob","path":"myDirectory/1stLevelFile.txt","mode":"100644"},{"id":"3501682ba833c3e50addab55e42488e98200b323","name":"top_level.txt","type":"blob","path":"top_level.txt","mode":"100644"}]
If I request the contents for top_level.txt they are returned without any issue via:
myserver.com/api/v4/projects/1/repository/files/top_level.txt?ref=master
However I am unable to access myDirectory/1stLevelFile.txt with any API call I try. E.g.:
myserver.com/api/v4/projects/1/repository/files/"myDirectory%2F1stLevelFile.txt"?ref=master
and,
myserver.com/api/v4/projects/1/repository/files/"myDirectory%2F1stLevelFile%2Etxt"?ref=master
Results in:
Not Found The requested URL /api/v4/projects/1/repository/files/myDirectory/1stLevelFile.txt was not found on this server.
Apache/2.4.25 (Debian) Server at myserver.com Port 443
myserver.com/api/v4/projects/1/repository/files/"myDirectory/1stLevelFile.txt"?ref=master and,
myserver.com/api/v4/projects/1/repository/files?ref=master&path=myDirectory%2F1stLevelFile.txt
Results in:
error "404 Not Found"
The versions of the components are:
GitLab 10.6.3-ee
GitLab Shell 6.0.4
GitLab Workhorse v4.0.0
GitLab API v4
Ruby 2.3.6p384
Rails 4.2.10
postgresql 9.6.8
According to my research there was a similar bug which was fixed with the 10.0.0 update.
I also added my ssh-key although I doubt it has any effect, following this advice with the same issue in php.
Solution:
I eventually solved it by adjusting the apache installed on the server.
Just follow these instructions: https://gitlab.com/gitlab-org/gitlab-ce/issues/35079#note_76374269

According to your code, I will go thinking you use curl.
If it is the case, why are you adding double quotes to your file path ?
The doc do not contains it.
Can you test it like that please ?
curl --request GET --header 'PRIVATE-TOKEN: XXXXXXXXX' myserver.com/api/v4/projects/1/repository/files/myDirectory%2F1stLevelFile%2Etxt?ref=master

Related

Getting 'forbidden' pushing a nuget package in github

Much like this thread: Publishing and Consuming GitHub Package Repository with NuGet: Unable to load the service index error
I have the csproj correct, the nuget.config correct (same as in that thread, but for my username), and following the answer where the token has all the rights, and I do the dotnet nuget add source, and the dotnet nuget push (same formatting/syntax).
However, I always always get this:
warn: <username> does not have the correct permissions to execute 'CreatePackageVersion'
Forbidden https://nuget.pkg.github.com/(username)/ 687ms
error: Response status code does not indicate success: 403 (Forbidden).
I've tried with/without the -k (git token) in the dotnet nuget push, no effect. The --interactive that it recommends, doesn't change anything.
I'm running this in a standard command line in the \bin\Release\netstandard2.0\publish directory, after having published to that folder.
Did already restart computer even after adding appropriate csproj and nuget.config data. Also tried doing #username and username (my username with and without an at sign, since all docs have no actual username examples, many blackened out).
(I do want it to be public readable, already added source .../(username)/index.json).
Check the RepositoryUrl in your csproj. It should match the repository you're uploading packages to. You may also need to set PublishRepositoryUrl.

django.db.utils.DatabaseError: Error while trying to retrieve text for error ORA-01804

Q1. What versions are we using?
Ans.
Python 3.6.12
OS : CentOS 7 64-bit
DB : Oracle 18c
Django 2.2
cx_Oracle : 8.1.0
Q2. Describe the problem
Ans. While running server with "python3 manage.py runserver"
application is able to contact Oracle DB and show the Django Administration page and login also works.
But when we access the application using the Apache (HTTPD) based URL over secure SSL port, we do see the Django page and the admin page as well but Login to Admin page with Internal server error.
In the logs, we see
"django.db.utils.DatabaseError: Error while trying to retrieve text for error ORA-01804"
cx_oracle is otherwise able to connect to the database properly, another application is also using the same database behind the same httpd proxy and works fine
Q3. Show the directory listing where your Oracle Client libraries are installed (e.g. the Instant Client directory). Is it 64-bit or 32-bit?
Ans. 64-bit
Q4. Show what the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) is set to?
LD_LIBRARY_PATH=/srv/vol/db/oracle/product/18.0.0/dbhome_1/lib:/lib:/usr/lib
PATH=$ORACLE_HOME/bin:/srv/vol/db/oracle/product/18.0.0/dbhome_1/lib:$PATH
Q5. Show any Oracle environment variables set (e.g. ORACLE_HOME, ORACLE_BASE).
ORACLE_HOME=/srv/vol/db/oracle/product/18.0.0/dbhome_1
TNS_ADMIN=$ORACLE_HOME/network/admin
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
ORACLE_BASE=/srv/vol/db/oracle
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/lib
Any suggestions/help is highly appreciated.
Thank you
I found the problem
So I just removed all the variable declarations from /etc/sysconfig/httpd and checked, the application was still able to access the lib files, so these were now redundant.
Then undid all variable declarations done earlier in .localsh and .localrc files for the os users. To start from scratch, and go step by step to see where it breaks.
So now, cx_Oracle was looking for the lib files in wrong directory
$ORACLE_HOME/client_1/lib
instead of
$ORACLE_HOME/lib
DPI-1047: Cannot locate a 64-bit Oracle Client library: "$ORACLE_HOME/client_1/lib/libclntsh.so: cannot open shared object file: No such file or directory". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help
I did not have any subfolder named "client_1" inside dbhome_1
so I just created a symlink client_1 that points to dbhome_1 (still unsure on this, but at least it works :) )
So, now, this error was gone but now again ORA-01804 was coming. 😑
I had read somewhere that this error can be fixed by adding "libociei.so" but I did not have one on my instance, so I generated it using these commands:-
mkdir -p $ORACLE_HOME/rdbms/install/instantclient/light
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk igenliboci
Then I just moved this libociei.so file from
$ORACLE_HOME/instantclient to $ORACLE_HOME/lib
Now there was a new error (so.. progress 😉 ):
ORA-12546 - TNS Permission Denied.
This was easy to solve 😀
I used this command to address this :-
setsebool -P httpd_can_network_connect on
And...... That was all! It worked.

(remote rejected) master -> master (pre-receive hook declined), Push rejected, failed to compile Node.js app

I know that there's couple posts like this one, but solution of any of them works for me.
Here is what I receive when I go for git push heroku master:
Please support. Ignoring node_modules is not working.
Docpad app - package.json file is updated according to docpad's manual.
I also have Procfile set up as in the link above.
PS. I have tried to deploy docpad app via openshift, but while Im going with manual from http://docpad.org/docs/deploy/ I receive error at step 5.
The application 'appname' is configured for git reference deployments but the
artifact provided ('https://github.com/myusername/appname#master') is a url.
Please provide a git reference to deploy (branch, tag or commit SHA1) or
configure your app to deploy from binaries with 'rhc configure-app appname
--deployment-type binary'.
If I configure myapp to deployment-type binary it isnt working neither.
The plugin which heroku tries to install returned 404 and the installation fails due to that.
Verify that the plugin is indeed public and not something you have wrote or used locally.
There is no package with this name hosted on the registry you use.
Remove the line with "docpad-plugin-blah": "2" from your package.json file. That line was provided in the docs simply to show you how to install plugins, but there's no such plugin as blah.
"dependencies": {
"docpad": "6"
},
I strongly recommend that you read through the Getting Started on OpenShift to get an overview of the development workflow using Git.
That being said, and if you really meant to use git reference deployments and you know why you are using them, then read through the Managing Deployments section on the developers page of OpenShift and find out how to properly set up git reference deployments. For instance, 'https://github.com/myusername/appname#master' is not a valid git url and therefore it cannot be cloned.

ERROR: CCurlFile::FillBuffer - Failed: HTTP response code said error(22) xbmc

I'm trying to host and distribute xbmc addon on my site. I've made a repository which points to the directory where the addon zip file is. At the same folder I have an xml which describes the addon and so the addon name and description are being recognized by xbmc.
However when trying to install the addon it shows 0% downloading progress and then the progress disappears - resulting in the following error inside xbmc.log file:
ERROR: CCurlFile::FillBuffer - Failed: HTTP response code said error(22)
according to curl errors page, this happens when -
CURLE_HTTP_RETURNED_ERROR (22)
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP
server returns an error code that is >= 400.
by that I assume the error may be caused by a misconfigured access permissions (perhaps I need to change some htaccess configuration?).
please help
I solved this on my own eventually. Apparently, the file structure was wrong - I needed to follow the file structure as mentioned in section 4.3 here in order for it to work

Problem creating RichFaces page theme

I'm trying to create a RichFaces page theme using the instructions here. I know NOTHING about Maven, so I've followed the instructions as best I can, but I've run into an error and don't know what I'm doing wrong. I followed the instructions on the page, and then run this command:
mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-theme -DarchetypeVersion=3.3.3.Final -DartifactId=test -DgroupId=org.richfaces.docs -Dversion=1.0mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-theme -DarchetypeVersion=3.3.3
However, when I run the command I get the following error message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0:create (default-cli) on project standalone-pom: Error creating from archetype: org.apache.maven.archetype.downloader.DownloadException: Error downloading org.richfaces.cdk:maven-archetype-theme:jar:3.3.3. Could not transfer artifact org.richfaces.cdk:maven-archetype-theme:jar:3.3.3 from/to repository.jboss.com (http://repository.jboss.com/maven2/): Access denied to: http://repository.jboss.com/maven2/org/richfaces/cdk/maven-archetype-theme/3.3.3/maven-archetype-theme-3.3.3.jar
[ERROR] org.richfaces.cdk:maven-archetype-theme:jar:3.3.3
I tried browsing to http://repository.jboss.com/maven2/, but I get an "Access Denied" error, just as stated in the error message. My question is, how do I rectify this? Is there a different URL that I should be using? If so, do I edit the Maven settings.xml file and use the new URL? I'd REALLY appreciate anyone that can give me some direction on this.
The link of the Jboss Repository for Maven specified in the jboss_profile.txt seems to be outdated.
You can try to replace all <url> of all Jboss Repository for Maven with https://repository.jboss.org/nexus/content/groups/public-jboss/ in your Maven settings.xml

Resources