Help with 404 errors - Everything else works

Added by John H over 3 years ago

Hi all,

I've been playing around with Redmine for two weeks now, and have successfully installed locally:
Redmine 2.4.5:
Mysql/Sql Server 2008 R2
Tomcat 7.0.42

Redmine 2.5.1:
Mysql/Sql Server 2008 R2
Tomcat 7.0.42

Ruby: 1.9.3
Jruby: 1.7.13 =====================================================================================================

With that being said, even though I have gotten it to work perfectly on a local instance of Tomcat, when I deploy the exact same redmine.war file on our hosted server, it throws a 404 error on all pages that deal with files/attachments.

i.e.
New Issue (can view issues added in sql manually, but can't create)
Documents (can't even add a document w/o an attachment)
Viewing a Users Profile

Furthermore, some of the fields are oddly filled in with "(NULL)" or "0"; please see attached image.

Everything else works. I can change settings, create users, projects, etc etc. I believe that it must have something to do with the deployable redmine.war, and more specifically directory permissions or just missing directories. I have attached a picture of my "WEB-INF" directory, and as you can see, there is no "attachement" or "files" folder, however the same structure works locally.

Finally, with the same install working locally, but not on a hosted machine, I can only assume that I need to modify some of the folder permissions, or add certain directories, so that attachments can be sent.

One last thing, I'm not sure if it may also be a token error, but I normally have to do 2 installs. One locally to create the database structure and load default data, and then one locally with jruby to create the redmine.war. I then move that .war file from my local machine to a hosted Tomcat webapp directory and restart Tomcat. If that is wrong, please inform me of my errors.

Thanks,
JohnH

Replies (4)

RE: Help with 404 errors - Everything else works - Added by John H over 3 years ago

Also, I didn't forget to attach to logs.

No logs are created in the hosted environment, which further makes me believe it is a permissions problem.
webapps/redmine/WEB-INF/log/ contains no files other than delete.me

RE: Help with 404 errors - Everything else works - Added by John H over 3 years ago

Here are some of the errors from the Tomcat logs, trying to reproduce the problem locally on Tomcat.

@INFO:
ActiveRecord::StatementInvalid (ActiveRecord::JDBCError: com.microsoft.sqlserver.jdbc.SQLServerException: The column 'id' was specified multiple times for 't'.: SELECT t.* FROM ( SELECT ROW_NUMBER() OVER AS _row_num, t.* FROM (SELECT DISTINCT [journals].id, journals.id FROM [journals] LEFT OUTER JOIN [issues] ON [issues].[id] = [journals].[journalized_id] LEFT OUTER JOIN [projects] ON [projects].[id] = [issues].[project_id] LEFT OUTER JOIN [journal_details] ON [journal_details].[journal_id] = [journals].[id] LEFT OUTER JOIN [users] ON [users].[id] = [journals].[user_id] AND [users].[type] IN (N'User', N'AnonymousUser') WHERE (journals.user_id = N'1') AND (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) AND ((journals.private_notes = 0 OR (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')))) AND (journals.journalized_type = 'Issue' AND (journal_details.prop_key = 'status_id' OR journals.notes <> ''))) AS t ) AS t WHERE t._row_num BETWEEN 1 AND 10):
lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb:82:in `find_events'
lib/redmine/activity/fetcher.rb:76:in `events'
lib/redmine/activity/fetcher.rb:75:in `events'
lib/redmine/activity/fetcher.rb:74:in `events'
app/controllers/users_controller.rb:65:in `show'

INFO:
ActiveRecord::RecordNotFound (Couldn't find Issue without an ID):
app/models/issue.rb:1317:in `update_nested_set_attributes_on_parent_change'
app/models/issue.rb:1302:in `update_nested_set_attributes'
app/models/issue.rb:165:in `create_or_update'
app/controllers/issues_controller.rb:150:in `create'

INFO: Parameters: {"utf8"=>"?", "authenticity_token"=>"KPRqzc2e6rwpTDZnBa+f9dEoH4VCddAZRirNpCVDYe0=", "issue"=>{"is_private"=>"0", "tracker_id"=>"1", "subject"=>"", "description"=>"", "status_id"=>"1", "priority_id"=>"2", "assigned_to_id"=>"", "parent_issue_id"=>"0", "start_date"=>"2014-07-07", "due_date"=>"", "estimated_hours"=>"", "done_ratio"=>"0"}, "attachments"=>{"1"=>{"filename"=>"500error.png", "description"=>"", "token"=>"1.ebd259e03747ddb4beb383a0c4b4001d"}}, "continue"=>"Create and continue", "project_id"=>"openings-studio"}

Jul 07, 2014 1:07:39 PM org.apache.catalina.core.ApplicationContext log
INFO: Current user: admin (id=1)

Jul 07, 2014 1:07:42 PM org.apache.catalina.core.ApplicationContext log
INFO: Completed 500 Internal Server Error in 3858.0ms

Jul 07, 2014 1:07:42 PM org.apache.catalina.core.ApplicationContext log
INFO:
NameError (wrong constant name (NULL)):
app/models/attachment.rb:239:in `find_by_token'
lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb:87:in `save_attachments'
lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb:80:in `save_attachments'
app/controllers/issues_controller.rb:149:in `create'
@

RE: Help with 404 errors - Everything else works - Added by John H over 3 years ago

@INFO: Parameters: {"utf8"=>"?", "authenticity_token"=>"KPRqzc2e6rwpTDZnBa+f9dEoH4VCddAZRirNpCVDYe0=", "issue"=>{"is_private"=>"0", "tracker_id"=>"1", "subject"=>"Damn", "description"=>"adsasda", "status_id"=>"1", "priority_id"=>"2", "assigned_to_id"=>"1", "parent_issue_id"=>"", "start_date"=>"2014-07-07", "due_date"=>"", "estimated_hours"=>"", "done_ratio"=>"0"}, "continue"=>"Create and continue", "project_id"=>"openings-studio"}

Jul 07, 2014 1:23:44 PM org.apache.catalina.core.ApplicationContext log
INFO: Current user: admin (id=1)

Jul 07, 2014 1:23:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Rendered mailer/_issue.text.erb (511.0ms)

Jul 07, 2014 1:23:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Rendered mailer/issue_add.text.erb within layouts/mailer (537.0ms)

Jul 07, 2014 1:23:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Rendered mailer/_issue.html.erb (172.0ms)

Jul 07, 2014 1:23:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Rendered mailer/issue_add.html.erb within layouts/mailer (191.0ms)

Jul 07, 2014 1:23:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Completed 404 Not Found in 9225.0ms

Jul 07, 2014 1:23:53 PM org.apache.catalina.core.ApplicationContext log
INFO:
ActiveRecord::RecordNotFound (Couldn't find Issue without an ID):
app/models/issue.rb:1317:in `update_nested_set_attributes_on_parent_change'
app/models/issue.rb:1302:in `update_nested_set_attributes'
app/models/issue.rb:165:in `create_or_update'
app/controllers/issues_controller.rb:150:in `create'

@

RE: Help with 404 errors - Everything else works - Added by John H over 3 years ago

I guess one thing that I realized I may need to do which I havent is:

Change the database.yml -> adapter -> From sqlserver to jdbc?

When deploying the redmine.war, do you need to first switch the database.yml?

(1-4/4)