Can't push to repo, error "remote: GitLab: API is not accessible

I think I may have misconfigured something during my GitLab install. I can access the web interface and create repos okay, but I can’t seem to push to them. Every time I try (in SourceTree), I get this error:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master
POST git-receive-pack (475 bytes)

remote: GitLab: API is not accessible[K

Pushing to http://git.ghostlyco.de/revxx14/new-site.git
To http://git.ghostlyco.de/revxx14/new-site.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://git.ghostlyco.de/revxx14/new-site.git'




Completed with errors, see above.

I’m not sure what that means. When I run this command:

sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

Which is provided in the installation documentation, everything looks good: http://git.ghostlyco.de/snippets/1

I did have one hiccup when installing, because I’m running Ubuntu 12.04, I wasn’t able to execute this command during the Redis setup process:

echo 'unixsocketperm 770' | sudo tee -a /etc/redis/redis.conf

I don’t know if that could be causing this issue or not. Any help would be greatly aprpeciated. I really don’t know what I’m doing, I’ve never used Git before, let alone any kind of Command Line stuff to any real extent. I’m amazed I was able to get this all up and running.

EDIT: You know, I wonder if it’s because I’m not on the same network… Does GitLab need a different port open other than the one for the web server?

The only thing I can find on this error is the source code for GitLab Shell. Apparently “resp” is not equal to “200”. Whatever that means :sweat:

I figured it out, I had forgot to set the gitlab_url in config.yml.

1 Like

What was your setting in file as I am facing similar issue and I have gitlab_url set to
gitlab_url: “http://127.0.0.1:8080

I found a solution. In my case i had migrated data from previous instance. It was found that database wasn’t migrated properly and status of gitlab-rake gitlab:migrate:status wasn’t completely okay.

I had to run gitlab-rake gitlab:migrate which fixed the issue.

@npatil

Did you figure this out? I am having the same issue. In the config.yml I have gitlab_url: “http://127.0.0.1:8080

Thanks

Yea,i forgot to set the gitlab_url in the gitlab.yml

Can you give some details…what it was and what you changed to?

Thanks for your time.

It’s been so long I don’t quite remember what it was initially. My guess is that it was just an empty string. It needs to be whatever the external URL you want to access GitLab at. In my case, that was https://git.mydomain.com/