Gitlab pull push not working - ruby

OVERVIEW
I am using Gitlab server locally in ubuntu 13.10 and I got following output in these command
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System: Ubuntu 13.10
Current User: git
Using RVM: no
Ruby Version: 2.0.0p247
Gem Version: 2.0.3
Bundler Version:1.5.3
Rake Version: 10.1.0
GitLab information
Version: 6.0.2
Revision: 10b0b8f
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://192.168.0.104
HTTP Clone URL: http://192.168.0.104/some-project.git
SSH Clone URL: git#192.168.0.104:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.7.0
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
xxx#xxx:/home/git/gitlab$ cd /home/git/
Now I sucessfully logged into the server with admin#local.host and create member and project. Then when I clone to the new project called testgitlab
by git clone http://192.168.0.104/sss/testgitlab.git
I could clone the project.
PROBLEM
1. When I try to commit the project I could do that. After commiting the project when I try to pull the Project git pull origin master then following error occurs:
:~/Desktop/testgitlab$ git pull origin master
Username for 'http://192.168.0.104': sss
Password for 'http://sss#192.168.0.104':
fatal: Couldn't find remote ref master
Unexpected end of command stream
2. After I get unsucessful in pulling the project I tried to push the project:
~/Desktop/testgitlab$ git push origin master
Username for 'http://192.168.0.104': sss
Password for 'http://sss#192.168.0.104':
Counting objects: 3, done.
Writing objects: 100% (3/3), 220 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find json-1.7.7 in any of the sources (Bundler::GemNotFound)
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `map!'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in `specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in `requested_specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in `setup'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: error: hook declined to update refs/heads/master
To http://192.168.0.104/username/testgitlab.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://192.168.0.104/sss/testgitlab.git'
When checking the gitlab status
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.7.0 ? ... OK (1.7.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ...
Administrator / sesh ... repository is empty
sss / TestGitlab ... repository is empty
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ...
Administrator / sesh ... can't create, repository is empty
sss / TestGitlab ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)
Checking GitLab ... Finished
I cannot figure out what I am missing ....
Help me out .
Thank you in advace !!!

I had a problem related to the issue 3384 that #Jonathan is referring to.
I solved it allowing the git user to login (modifying the /etc/passwd to set the shell to bash for the git user).
See my answer here: GitLab 7-0 stable not able to push or clone

An issue on github indicates, that it might have something to do with the unicorn/nginx/gitlab-shell configuration. Make sure to double check all the configs:
https://github.com/gitlabhq/gitlabhq/issues/3384

Related

Heroku-18: Git push fails. Showing different versions of Ruby on push

My apologies if this is a dumb question. I am not familiar with anything about Ruby. Also tried several solutions from SO. Managed to upgrade Ruby, resolve dependencies. Now just stuck and not able to move ahead. Any help is appreciated.
Thank you.
When I push, I get ruby v2.2.2 but I just upgraded to 2.5.7 which is supported by heroku-18.
Here are CLI records:
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.2.2.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.2.2.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:
remote: !
remote: ! An error occurred while installing ruby-2.2.2
remote: !
remote: ! This version of Ruby is not available on Heroku-18. The minimum supported version
remote: ! of Ruby on the Heroku-18 stack can found at:
remote: !
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to appname-heroku18.
remote:
To https://git.heroku.com/appname-heroku18.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appname-heroku18.git'
Mac-Air:appname developer$ ruby -v
ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin18]
Mac-Air:appname developer$ heroku run ruby -v
› Error: Multiple apps in git remotes
› Usage: --remote heroku-18
› or: --app appname-heroku18
› Your local git repository has more than 1 app referenced in git
› remotes.
› Because of this, we can't determine which app you want to run this
› command against.
› Specify the app you want with --app or --remote.
› Heroku remotes in repo:
› appname (heroku)
› appname-heroku18 (heroku-18)
›
› https://devcenter.heroku.com/articles/multiple-environments
Mac-Air:appname developer$ heroku run ruby -v --remote
› Error: Flag --remote expects a value
Mac-Air:appname developer$ heroku run ruby -v --remote heroku
Running ruby -v on ⬢ appname... up, run.1515 (Free)
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
Mac-Air:appname developer$ heroku run ruby -v --remote heroku-18
Running ruby -v on ⬢ appname-heroku18... up, run.1012 (Free)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
Mac-Air:appname developer$ heroku run ruby -v --app appname-heroku18
Running ruby -v on ⬢ appanme-heroku18... up, run.6356 (Free)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
you have two apps in your remote that is currently referenced by your git.
just specify the app name in your push command.
git push ... --app appname-heroku18
It seems to me that you have locked the Ruby version. That's why it keeps trying to install Ruby 2.2.2. By default it should just pick a stable Ruby version.
Look into your Gemfile for a ruby entry. There it should say 2.2.2. Either remove it or lock the version to 2.5.7.
-> git push heroku master #I run this in my app and I got the error message for the app.
I check the "config" file under the "./git/" It IS showing 2 Apps:
[remote "origin"]
url = https://git.heroku.com/yinow.git
fetch = +refs/heads/*:refs/remotes/origin/*
# [remote "heroku"]
# url = https://git.heroku.com/yinow.git
# fetch = +refs/heads/*:refs/remotes/heroku/***
I comment out the "heroku" part as above, and run the push command again like this:
-> git push origin master
and the problem gone!

Ruby Heroku deployment failing: This version of Ruby is not available on Heroku-18. How can I upgrade my ruby version and make the deployment succeed?

What is the most efficient way of upgrading Ruby on Mac OS High Sierra?
I am trying to deploy my simple Ruby app onto Heroku.
I am running the command:
git push heroku master
However, I am getting the following error:
18:11 $ git push heroku master
Counting objects: 97, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (82/82), done.
Writing objects: 100% (97/97), 22.59 KiB | 1.88 MiB/s, done.
Total 97 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to
handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See
https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-
delay 1 --connect-timeout 3 --max-time 30 https://s3-external-
1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.3.tgz -s -o - | tar
zxf - ' failed on attempt 1 of 3.
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-
delay 1 --connect-timeout 3 --max-time 30 https://s3-external-
1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.3.tgz -s -o - | tar
zxf - ' failed on attempt 2 of 3.
remote:
remote: !
remote: ! An error occurred while installing ruby-2.3.3
remote: !
remote: ! This version of Ruby is not available on Heroku-18. The
minimum supported version
remote: ! of Ruby on the Heroku-18 stack can found at:
remote: !
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-
runtimes
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to morning-plains-67699.
remote:
To https://git.heroku.com/morning-plains-67699.git
! [remote rejected] master -> master (pre-receivehook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-plains-
67699.git'
Heroku doesn't support Ruby 2.3.3
Heroku supports the following Ruby versions and the associated Rubygems. A supported version means that you can expect our tools and platform to work with a given version. It also means you can receive technical support. Here are our supported Ruby versions:
MRI:
2.4.5 : patchlevel 335, Rubygems: 2.6.14.3
2.5.3: patchlevel 105, Rubygems: 2.7.6
2.6.0: patchlevel 0, Rubygems: 3.0.1
Read at Heroku
Also read information how to specify Ruby version.
Check the latest version of ruby in this link https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
then run the latest one rvm install ruby-2.4.6
type ruby -v in the terminal, you should see ruby 2.4.6.
If it still shows you ruby 2.0., run rvm use ruby-2.4.6 --default.
Change the ruby version in your gem file then bundle
This solve my problem
I had the same or similar error. In my case I did check the branches of the remote , git remote show heroku.
I had a branch main , but no a master , so I made a git checkout
git checkout -b main
And then
git push heroku main
Everything was resolved.

Git can't find set buildpack

So I am learning how to use git with Heroku and I can't seem to git push my set repo. So I set the buildpack to ruby with Heroku as ruby by doing so..
root#slacker:~/ruby# heroku buildpacks:set heroku/ruby
Buildpack set. Next release on stormy-earth-98069 will use heroku/ruby.
Run git push heroku master to create a new release using this buildpack.
Next I try to update my repo using git push and I get an error saying this..
root#slacker:~/ruby# git push heroku master
...
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
...
So I am wondering what could cause git to do this?
Your question has the answer. According docs, looks like the directory from where you are running 'git push' doesn't have Gemfile.

Another GitLab "Can't save project. Please try again later"

I did a fresh install from source of GitLab 7.2 stable (7.2.1) and when I try to create a project I get the message:
Can't save project. Please try again later
Although, I can create users and groups just fine.
I modified the /gitlab/app/services/projects/create_service.rb to print the exception error message and it says:
undefined local variable or method `tagging_contexts' for #<Project:0xb983b318>
Searching through the gems folder, it looks like it is related to gem acts-as-taggable-on-3.4.1
The Gemfile and Gemfile.lock have that reference in place. And I also have it in the directory gitlab/vendor/bundle/ruby/2.1.0/gems.
Does anyone know why am I getting this error and how to fix it?
Information about the system:
Installation on ODROID-XU3 was based on https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md and https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md, but I had to remove gems pg and therubyracer. Gem jquery-ui-rails I had to force version "~> 4.2.1".
Git-core and Ruby were built from source. Redis-server and Redis-tools were installed from package version 2.8.4-2.
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.1.2p95
Gem Version: 2.2.2
Bundler Version:1.7.2
Rake Version: 10.3.2
Sidekiq Version:2.17.0
GitLab information
Version: 7.2.1
Revision: ff1633f
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://192.168.1.150
HTTP Clone URL: http://192.168.1.150/some-project.git
SSH Clone URL: git#192.168.1.150:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.9.7
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.9.7 ? ... OK (1.9.7)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... can't check, you have no projects
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories/: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.4
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... can't check, you have no projects
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.2)
Your git bin path is "/usr/local/bin/git"
Git version >= 1.7.10 ? ... yes (2.1.0)
Checking GitLab ... Finished

Push to Heroku hanging after ative_admin fetch

Guys I have no clue why this push to Heroku isn't working. Any ideas?
Fetching git://github.com/gregbell/active_admin.git
fatal: Could not parse object '54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f'.
Git error: command `git reset --hard 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f`
in directory
/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/bundler/gems/active_admin-54fb71c5415f
has failed.
If this error persists you could try removing the cache directory
'/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'
Bundler Output: Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Fetching git://github.com/justinfrench/formtastic.git
Fetching git://github.com/josevalim/inherited_resources.git
Fetching git://github.com/ernie/ransack.git
Fetching git://github.com/gregbell/active_admin.git
fatal: Could not parse object '54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f'.
Git error: command `git reset --hard 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f`
in directory
/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/bundler/gems/active_admin-54fb71c5415f
has failed.
If this error persists you could try removing the cache directory
'/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app
I had this error today and found that my Gemfile.lock file included a reference to the same commit you were using:
GIT
remote: git://github.com/gregbell/active_admin.git
revision: 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f
branch: rails4
specs:
activeadmin (0.6.0)
...
I'm not sure why that commit is no longer available but I was able to specify one in my Gemfile using the :ref option:
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4', ref: 'a9949c1524205928b18597f840e83478ba97c2ef'
The resulting change to Gemfile.lock:
GIT
remote: git://github.com/gregbell/active_admin.git
revision: a9949c1524205928b18597f840e83478ba97c2ef
ref: a9949c1524205928b18597f840e83478ba97c2ef
branch: rails4
specs:
activeadmin (0.6.0)
...
This feels like a safer way to control when including libraries directly from Github.

Resources