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

Edit Repository returns Internal error #299

Closed
tomas-korec opened this issue Oct 20, 2014 · 5 comments
Closed

Edit Repository returns Internal error #299

tomas-korec opened this issue Oct 20, 2014 · 5 comments
Assignees
Labels

Comments

@tomas-korec
Copy link

Hi,

I have found out that Project Page > Settings > Repositories > Edit returns Internal Error.
In production.log there is:

Started GET "/repositories/7/edit" for 10.10.0.6 at 2014-10-20 10:45:23 +0200
Processing by RepositoriesController#edit as HTML
  Parameters: {"id"=>"7"}
  Current user: username (id=5)
  Rendered plugins/redmine_git_hosting/app/views/common/_git_urls.html.erb (4.0ms)
  Rendered plugins/redmine_git_hosting/app/views/repositories/_form.html.erb (99.7ms)
  Rendered plugins/redmine_git_hosting/app/views/repositories/edit.html.erb within layouts/base (104.7ms)
Completed 500 Internal Server Error in 110.7ms

ActionView::Template::Error (undefined method `[]' for nil:NilClass):
    149: 
    150:       

151: <%= label_tag "", l(:label_repository_default_branch) %> 152: <% if !@repository.new_record? && !@repository.branches.empty? %> 153: <%= select_tag "extra[default_branch]", options_for_select(@repository.branches.collect{ |b| [b.to_s, b.to_s] }, :selected => @repository.branches.find{ |b| b.is_default}.to_s) %> 154: <% else %> 155: <%= @repository.extra[:default_branch] %> lib/redmine/scm/adapters/git_adapter.rb:88:in `block (2 levels) in branches' lib/redmine/scm/adapters/git_adapter.rb:86:in `each_line' lib/redmine/scm/adapters/git_adapter.rb:86:in `block in branches' lib/redmine/scm/adapters/git_adapter.rb:85:in `branches' app/models/repository/git.rb:75:in `branches' app/helpers/application_helper.rb:1042:in `labelled_form_for'

In git_hosting.log there is nothing.

It seem the issue is similar to #198

I had version 0.7.6 so I updated to 0.7.7, but issiue is still there. I didn't test 0.8-beta, because of this error:

You cannot specify the same gem twice with different version requirements.
You specified: shoulda (~> 3.3.2) and shoulda (~> 3.5.0)

What can I do to solve the Internal Error?

Thanks, Tom.

@tomas-korec
Copy link
Author

I have a new info. When I wanted to delete my repository a create it again I've noticed this in git_hosting.log:

delete:

2014-10-24 14:15:11 +0200 INFO [GitHosting] Clean cache before delete repository 'reponame'
2014-10-24 14:15:11 +0200 INFO [GitCache] Removed '1' expired cache entries for repository 'project/reponame'
2014-10-24 14:15:12 +0200 INFO [GitHosting] User 'username' has removed repository 'reponame'
2014-10-24 14:15:12 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-10-24 14:15:12 +0200 INFO [GitWorker] delete_repositories : repository 'reponame' exists in Gitolite, delete it ...
2014-10-24 14:15:12 +0200 INFO [GitWorker] delete_repositories : commiting to Gitolite...
2014-10-24 14:15:12 +0200 ERROR [GitWorker] Command failed [128]: /usr/bin/git --git-dir=/tmp/redmine_git_hosting/git/gitolite-admin.git/.git --work-tree=/tmp/redmine_git_hosting/git/gitolite-admin.git commit -a -m 'delete_repositories : reponame' --author='Redmine Git Hosting '
[GitWorker]
[GitWorker]
[GitWorker]*** Please tell me who you are.
[GitWorker]
[GitWorker]Run
[GitWorker]
[GitWorker]  git config --global user.email "you@example.com"
[GitWorker]  git config --global user.name "Your Name"
[GitWorker]
[GitWorker]to set your account's default identity.
[GitWorker]Omit --global to set the identity only in this repository.
[GitWorker]
[GitWorker]fatal: empty ident name (for ) not allowed
[GitWorker]
2014-10-24 14:15:12 +0200 INFO [GitWorker] delete_repositories : pushing to Gitolite...
2014-10-24 14:15:12 +0200 INFO [GitWorker] delete_repositories : done !

create:

2014-10-24 14:29:50 +0200 INFO [GitHosting] Installing Redmine Gitolite mirroring SSH keys ...
2014-10-24 14:29:52 +0200 INFO [GitHosting] Done !
2014-10-24 14:30:31 +0200 INFO [GitHosting] User 'username' created a new repository 'reponame'
2014-10-24 14:30:31 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-10-24 14:30:31 +0200 INFO [GitWorker] add_repository : repository 'reponame' does not exist in Gitolite, create it ...
2014-10-24 14:30:31 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-10-24 14:30:31 +0200 ERROR [GitWorker] Command failed [128]: /usr/bin/git --git-dir=/tmp/redmine_git_hosting/git/gitolite-admin.git/.git --work-tree=/tmp/redmine_git_hosting/git/gitolite-admin.git commit -a -m 'add_repository : reponame' --author='Redmine Git Hosting '
[GitWorker]
[GitWorker]
[GitWorker]*** Please tell me who you are.
[GitWorker]
[GitWorker]Run
[GitWorker]
[GitWorker]  git config --global user.email "you@example.com"
[GitWorker]  git config --global user.name "Your Name"
[GitWorker]
[GitWorker]to set your account's default identity.
[GitWorker]Omit --global to set the identity only in this repository.
[GitWorker]
[GitWorker]fatal: empty ident name (for ) not allowed
[GitWorker]
2014-10-24 14:30:31 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/reponame.git'
2014-10-24 14:30:31 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-10-24 14:30:31 +0200 INFO [GitWorker] add_repository : done !
2014-10-24 14:30:31 +0200 INFO [GitWorker] Create README file for repository 'reponame'
2014-10-24 14:30:33 +0200 ERROR [GitWorker] Error while creating README file for repository 'reponame'
2014-10-24 14:30:33 +0200 ERROR [GitWorker] Command output : ''
2014-10-24 14:30:34 +0200 ERROR [GitCache] Git exited with non-zero status : 128

@tomas-korec
Copy link
Author

I have set git user.email and user.name for redmine user and log has changed, but Internal error is still there.

create:

2014-10-24 14:36:06 +0200 INFO [GitWorker] delete_repositories : pushing to Gitolite...
2014-10-24 14:36:06 +0200 INFO [GitWorker] delete_repositories : done !
2014-10-24 14:37:18 +0200 INFO [GitHosting] User 'username' created a new repository 'reponame'
2014-10-24 14:37:18 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-10-24 14:37:18 +0200 INFO [GitWorker] add_repository : repository 'reponame' does not exist in Gitolite, create it ...
2014-10-24 14:37:18 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-10-24 14:37:18 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/reponame.git'
2014-10-24 14:37:18 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-10-24 14:37:20 +0200 INFO [GitWorker] add_repository : done !
2014-10-24 14:37:20 +0200 INFO [GitWorker] Create README file for repository 'reponame'
2014-10-24 14:37:23 +0200 ERROR [GitWorker] Error while creating README file for repository 'reponame'
2014-10-24 14:37:23 +0200 ERROR [GitWorker] Command output : ''

delete:

2014-10-24 14:42:38 +0200 INFO [GitHosting] Clean cache before delete repository 'reponame'
2014-10-24 14:42:38 +0200 INFO [GitCache] Removed '1' expired cache entries for repository 'project/reponame'
2014-10-24 14:42:39 +0200 INFO [GitHosting] User 'username' has removed repository 'reponame'
2014-10-24 14:42:39 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-10-24 14:42:39 +0200 INFO [GitWorker] delete_repositories : repository 'reponame' exists in Gitolite, delete it ...
2014-10-24 14:42:39 +0200 INFO [GitWorker] delete_repositories : commiting to Gitolite...
2014-10-24 14:42:39 +0200 INFO [GitWorker] delete_repositories : pushing to Gitolite...
2014-10-24 14:42:39 +0200 INFO [GitWorker] delete_repositories : done !

@tomas-korec
Copy link
Author

I have solved "Error while creating README file" with this manual: https://jbox-web.github.io/redmine_git_hosting/configuration/troubleshooting/#initialization-of-the-repo-with-readme-file-does-not-work
I would add this step:

chmod 644 .ssh/config

before git clone
Otherwise there is this error:

git clone ssh://git@localhost/gitolite-admin.git /tmp/gitolite-admin-temp
Cloning into '/tmp/gitolite-admin-temp'...
Bad owner or permissions on /home/redmine/.ssh/config
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

But there is this error now when creating/deleting repository:

[GitWorker]
[GitWorker]To ssh://git@localhost/gitolite-admin.git
[GitWorker] ! [rejected]        master -> master (fetch first)
[GitWorker]error: failed to push some refs to 'ssh://git@localhost/gitolite-admin.git'
[GitWorker]hint: Updates were rejected because the remote contains work that you do
[GitWorker]hint: not have locally. This is usually caused by another repository pushing
[GitWorker]hint: to the same ref. You may want to first integrate the remote changes
[GitWorker]hint: (e.g., 'git pull ...') before pushing again.
[GitWorker]hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[GitWorker]

@tomas-korec
Copy link
Author

Ok, I have solved last error by:

root$ su - redmine
redmine$ vim .ssh/config
* [add this]
Host localhost
  User git
  IdentityFile /home/redmine/redmine/plugins/redmine_git_hosting/ssh_keys/redmine_gitolite_admin_id_rsa
  IdentitiesOnly yes

then:

chmod 644 .ssh/config
cd /tmp/redmine_git_hosting/git/gitolite-admin.git/ #which is my gitolite temp directory (check config test)
git pull

Simple deletion of the gitolite temp directory should also work fine.

But still cannot create a README file:

2014-10-24 15:54:06 +0200 INFO [GitWorker] Create README file for repository 'reponame'
2014-10-24 15:54:06 +0200 ERROR [GitWorker] Error while creating README file for repository 'reoname'
2014-10-24 15:54:06 +0200 ERROR [GitWorker] Command output : ''

and there is still internal error I mentioned in my first comment... :/

@n-rodriguez
Copy link
Contributor

For the very first error (ActionView::Template::Error (undefined method []' for nil:NilClass):`) : just refresh your browser. It's a cache problem but I don't know where it comes from.

For your create/delete issue this may be linked to #317 (fixed in 0.7.9).

To fix 'Allow modification of the gitolite-admin repository from a different location' switch to v0.8.

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

No branches or pull requests

2 participants