kubitron / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
78 stars 15 forks source link

Internal Server Error when saving plugin settings #67

Closed frasten closed 12 years ago

frasten commented 12 years ago

I'm using the latest commit (0525cdc2fe) from the testing branch, and I'm running Redmine 1.4.4.

When I go to http://REDMINE_ROOT_URL/settings/plugin/redmine_git_hosting and hit save, I get an Internal Server Error. The error log reports:

NoMethodError (undefined method `>' for nil:NilClass):
  vendor/plugins/redmine_git_hosting/app/models/git_hosting_settings_observer.rb:146:in `before_save'

(complete log here)

Thank you for your amazing work!

saric commented 12 years ago

I've tested plugin on clean Redmine 1.4.4 installation (fresh install without any other plugins) and using redmine_git_hosting from testing branch.

Plugin configuration settings (http://REDMINE_ROOT_URL/settings/plugin/redmine_git_hosting) gives 500 Internal Server Error. gitTemporaryDir was created with wrong permissions or ownership. After changing ownership of gitTemporaryDir to WEB_USER, the page is normally loaded. When I hit save, I get an 500 Internal Server Error, as described.

kubitron commented 12 years ago

Did you execute a "db:migrate_plugins" ?

kubitron commented 12 years ago

Actually -- can you tell me more? Run the ./scripts/about (will need to set RAILS_ENV to production first).

Also, what settings were gitTemporaryDir created with?

Are these problems only with the settings page? Or, are they with other pages?

frasten commented 12 years ago

Thank you for your answer. I've executed:

rake redmine_git_hosting:remove_scripts RAILS_ENV=production
rake redmine_git_hosting:restore_defaults RAILS_ENV=production
rake db:migrate_plugins RAILS_ENV=production
rake redmine_git_hosting:install_scripts RAILS_ENV=production WEB_USER=apache
sudo -u apache rake redmine_git_hosting:update_repositories RAILS_ENV=production

But unfortunately this issue is still present.

frasten commented 12 years ago

I've executed: script/about RAILS_ENV=production The output is here.

gitTempDataDir is set to "/tmp/redmine_git_hosting/".

root@hydraulics-prod:# ls -lha /tmp/redmine_git_hosting/
totale 12K
drwxr-xr-x  3 apache apache 4,0K 26 set 17:12 .
drwxrwxrwt. 6 git    git    4,0K 26 set 17:30 ..
drwx------  3 apache apache 4,0K 26 set 17:26 git

I can also confirm issue #69 on my setup. The errors are similar. Thank you! :-)

kubitron commented 12 years ago

For some reason, the RAIL_ENV=production is not working properly. Are you using bash?

Try:

prompt% export RAILS_ENV=production
prompt% script/about

Also, there were a couple of bugs in that version of the testing branch. Can you pull again?

frasten commented 12 years ago

Thank you, here is the output: http://pastie.org/4810397. Using commit b445672b92, this issue is still here; here is the updated log: http://pastie.org/4810402

kubitron commented 12 years ago

Ok. I think that I have this problem. I'm assuming that you have no Git repos yet. Oops.

Try pulling from testing again and see if this fixes it.

frasten commented 12 years ago

Wonderful: a8fffbf fixes this issue :-)

kubitron commented 12 years ago

Great! Thanks for closing the bug.