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

404 Not Found after upgrade to v1.6.0 #799

Closed
friend-yara opened this issue Nov 7, 2017 · 4 comments
Closed

404 Not Found after upgrade to v1.6.0 #799

friend-yara opened this issue Nov 7, 2017 · 4 comments
Assignees
Labels

Comments

@friend-yara
Copy link

  1. Redmine 3.4.3.stable, ruby 2.2.8-p477 (2017-09-14) [x86_64-linux-gnu], Rails 4.2.8; Environment production, database adapter Mysql2; mysql Ver 14.14 Distrib 5.7.20
  2. git pull && git checkout v1.6.0
  3. bundle install && bundle exec rake redmine:plugins:migrate RAILS_ENV="production":
...
== 20170418104901 MigrateDocuments: migrating =================================
-- DmsfFile ID 1: project = nil
-- DmsfFile ID 2: project = nil
-- DmsfFile ID 3: project = nil
...
-- DmsfFile ID 115: project = nil
-- DmsfFile ID 115: project = nil
== 20170418104901 MigrateDocuments: migrated (0.3729s) ========================
...

(see attach)
3) restart thin
4) (in web browser) [Any project] -> Documents -> [click on any document folder] -> [click on document or link to document] -> 404
5) In log/production.log:

me@redmine$ tail ./log/production.log
Completed 200 OK in 142ms (Views: 66.4ms | ActiveRecord: 56.9ms)
Started GET "/dmsf/files/134/view" for 127.0.0.1 at 2017-11-07 21:45:03 +0300
Processing by DmsfFilesController#view as HTML
  Parameters: {"id"=>"134"}
  Current user: admin (id=1)
2017-11-07 21:45:03 admin@127.0.0.1/192.168.1.45: downloaded dmsf://my_project/134/212
Sent file /srv/www/redmine/files/dmsf/2017/01/170112200222_134_1__1_.__-02.pdf (0.3ms)
Cannot read file /srv/www/redmine/files/dmsf/2017/01/170112200222_134_1__1_.__-02.pdf
  Rendered common/error.html.erb within layouts/base (0.4ms)
Completed 404 Not Found in 157ms (Views: 24.1ms | ActiveRecord: 109.1ms)
me@redmine$ find . -name 170112200222_134_1__1_.__-02.pdf
./files/dmsf/my_project/170112200222_134_1__1_.__-02.pdf

With older version of dmsf everything was fine.

dmsf-v1.6.0-migrate-error.txt

@picman picman self-assigned this Nov 8, 2017
@picman
Copy link
Collaborator

picman commented Nov 8, 2017

The bug is related to #767 and you obviously didn't use the latest stable code.

git checkout master

From the attached log:

== 20170418104901 MigrateDocuments: migrated (0.3729s) ========================
== 20170421101901 DmsfFileContainerRollback: migrating ========================

But, the master branch contain 20170422104901_migrate_documents.rb and not 20170418104901_migrate_documents.rb. On the file name depends the migration order. The migration must be run in reverse order:

== 20170421101901 DmsfFileContainerRollback: migrating ========================
== 20170422104901 MigrateDocuments: migrated (0.3729s) ========================

At the moment it would be difficult to roll back and migrate again for you. It would be easier to migrate documents manually. Please see #767, there is a useful script for the manual migration.

@picman picman closed this as completed Nov 8, 2017
@picman picman added invalid and removed type: bug labels Nov 8, 2017
@friend-yara
Copy link
Author

I restored the Redmine database from the backup, then:

$ cd plugins/redmine_dmsf && git pull && git checkout master
$ bundle install && bundle exec rake redmine:plugins:migrate RAILS_ENV="production"

and now it's working. Redmine displays DMSF version 1.6.0. Thanks!

@rems4e
Copy link

rems4e commented Nov 16, 2017

The fix for this issue is 2 months old, and yet the 1.6.0 version has not been removed from download? At the very least, a 1.6.1 with the fix should have been deployed as soon as possible.

Do you intend to let everybody break their installation with this update?

@picman
Copy link
Collaborator

picman commented Nov 20, 2017

You're right. I've just updated the last release.

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

3 participants