Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First run of gitlab cookbook fails with git error. #97

Open
briandoodyie opened this issue Jun 12, 2015 · 7 comments
Open

First run of gitlab cookbook fails with git error. #97

briandoodyie opened this issue Jun 12, 2015 · 7 comments

Comments

@briandoodyie
Copy link

I'm overriding the git config file to redirect git protocol requests to use https as this protocol is disabled on our machines.

Error i'm seeing is "STDERR: error: You have local changes to 'doc/workflow/importing/README.md'; cannot switch branches."

Running the cookbook a second time succeeds though.

@atomic-penguin
Copy link
Owner

This is odd, is it a new install, or an upgrade? If an upgrade, it could be the git tree has local modifications that were not checked in. I don't know of anything in the cookbook that modifies the doc tree, however.

@briandoodyie
Copy link
Author

Yes this is a new install. I've ran it a few times on differen vms and its always the same message. Running it a second time works though which doesnt make huge sense to me.

@epcim
Copy link
Collaborator

epcim commented Jun 16, 2015

hi, I got the similar (on centos6 image), first run in CI env.:

  --- /srv/git/gitlab-shell/config.yml  2015-06-16 08:15:36.417000019 +0000
           +++ /tmp/chef-rendered-template20150616-8718-uejf10  2015-06-16 08:15:36.416000020 +0000
           @@ -1 +1,41 @@
           +# GitLab user. git by default


           +# Url to gitlab instance. Used for api calls. Should end with a slash.


           +http_settings:
           +#  user: someone

           +#  ca_file: /etc/ssl/cert.pem




           +# Repositories path
           +# REPOS_PATH MUST NOT BE A SYMLINK!!!
           +repos_path: /srv/git/repositories
           +
           +# File used as authorized_keys for gitlab user
           +auth_file: /srv/git/.ssh/authorized_keys
           +
           +# Redis settings used for pushing commit notices to gitlab
           +redis:
           +  bin: /usr/local/bin/redis-cli
           +  host: 127.0.0.1
           +  port: 6379
           +  # socket: /tmp/redis.socket # Only define this if you want to use sockets

       +
           +# Log file.
           +# Default is gitlab-shell.log in the root directory.
           +# log_file: "/home/git/gitlab-shell/gitlab-shell.log"
           +
           +# Log level. INFO by default
           +log_level: INFO
           +
           +# Audit usernames.
           +# Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but
           +# incurs an extra API call on every gitlab-shell command.

           - change mode from '' to '0644'
           - change owner from '' to 'git'
           - change group from '' to 'git'


       - clone from git://github.com/gitlabhq/gitlabhq.git into /srv/git/gitlab
           ================================================================================
           Error executing action `checkout` on resource 'git[/srv/git/gitlab]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'
           ---- Begin output of git checkout deploy ----
           STDOUT: 
           STDERR: error: You have local changes to 'doc/api/groups.md'; cannot switch branches.
           ---- End output of git checkout deploy ----
           Ran git checkout deploy returned 1

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/gitlab/recipes/default.rb

           159: git node['gitlab']['app_home'] do
           160:   repository node['gitlab']['git_url']
           161:   reference node['gitlab']['git_branch']
           162:   action :checkout
           163:   user node['gitlab']['user']
       164:   group node['gitlab']['group']
           165: end
           166: 

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/gitlab/recipes/default.rb:159:in `from_file'

           git("/srv/git/gitlab") do
             action [:checkout]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             destination "/srv/git/gitlab"
         enable_checkout true
         revision "7-7-stable"
             remote "origin"
             checkout_branch "deploy"
             declared_type :git
             cookbook_name "gitlab"
             recipe_name "default"
             repository "git://github.com/gitlabhq/gitlabhq.git"
             user "git"
             group "git"
           end

       Recipe: openssh::default
         * service[ssh] action restart
           - restart service service[ssh]

       Running handlers:
       [2015-06-16T08:18:31+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2015-06-16T08:18:31+00:00] ERROR: Exception handlers complete
       [2015-06-16T08:18:31+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       Chef Client failed. 131 resources updated in 1847.104861494 seconds
       [2015-06-16T08:18:32+00:00] ERROR: git[/srv/git/gitlab] (gitlab::default line 159) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
       ---- Begin output of git checkout deploy ----
       STDOUT: 
       STDERR: error: You have local changes to 'doc/api/groups.md'; cannot switch branches.
       ---- End output of git checkout deploy ----
       Ran git checkout deploy returned 1
       [2015-06-16T08:18:34+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <default-centos-6>.
>>>>>> Please see .kitchen/logs/default-centos-6.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c '

sudo -E /opt/chef/bin/chef-client --local-mode --config /tmp/kitchen/client.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json --chef-zero-port 8889
']
>>>>>> ----------------------
$ KITCHEN_LOCAL_YAML=.kitchen.cloud.yml chef exec kitchen destroy
-----> Starting Kitchen (v1.4.0)
-----> Destroying <default-centos-6>...
       OpenStack instance <8a2bb4e2-f9cf-4902-aa87-96ac239c9142> destroyed.
       Finished destroying <default-centos-6> (0m2.50s).
-----> Destroying <default-ubuntu-1404>...
       Finished destroying <default-ubuntu-1404> (0m0.00s).
-----> Kitchen is finished. (0m7.41s)
$ test -n $E && exit $E

@chewi
Copy link
Collaborator

chewi commented Jul 23, 2015

I've seen this on a new kitchen run with CentOS 6.5. It complained about groups.md.

@chewi
Copy link
Collaborator

chewi commented Jul 28, 2015

I don't know why but this doesn't seem to happen with more recent GitLab versions.

@gilhauer
Copy link

I'm seeing the exact same problem; building a vagrant box with CentOS 6.5.

Is there any resolution to this?

@briandoodyie
Copy link
Author

If you run chef-client a second time, I found that it does work but that's not a great workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants