Content
You are here:
[solved]After update to OP 4 I cannot display uploaded png
Added by Bernd Müller over 9 years ago
Hi!
I cannot not display any images after updating OP to the latest version.
Maybe this log gives someone an idea what is going wrong. Any help is appreciated.
Cheers
ActionController::RoutingError (No route matches [GET] "/install1.PNG"): actionpack (3.2.21) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (3.2.21) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' railties (3.2.21) lib/rails/rack/logger.rb:32:in `call_app' railties (3.2.21) lib/rails/rack/logger.rb:16:in `block in call' activesupport (3.2.21) lib/active_support/tagged_logging.rb:22:in `tagged' railties (3.2.21) lib/rails/rack/logger.rb:16:in `call' request_store (1.1.0) lib/request_store/middleware.rb:8:in `call' actionpack (3.2.21) lib/action_dispatch/middleware/request_id.rb:22:in `call' rack (1.4.5) lib/rack/methodoverride.rb:21:in `call' rack (1.4.5) lib/rack/runtime.rb:17:in `call' activesupport (3.2.21) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.4.5) lib/rack/lock.rb:15:in `call' rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward' rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch' rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!' rack-cache (1.2) lib/rack/cache/context.rb:51:in `call' airbrake (4.1.0) lib/airbrake/user_informer.rb:16:in `_call' airbrake (4.1.0) lib/airbrake/user_informer.rb:12:in `call' railties (3.2.21) lib/rails/engine.rb:484:in `call' railties (3.2.21) lib/rails/application.rb:231:in `call' railties (3.2.21) lib/rails/railtie/configurable.rb:30:in `method_missing' Processing by WorkPackagesController#preview as */* Parameters: {"..I delete this here.."} Rendered common/preview.html.erb (24.4ms) Completed 500 Internal Server Error in 173.9ms
Replies (20)
I guess that somehow the way that attachments get handled, seems to be changed.
I found the the folder “files” in it I got all the files I have uploaded previously, now it seems like all new uploaded files go to /files/attachement/file/. This is a new structure. But still the folder is accessible ->as OP was able to upload the files that I cannot display.
Any suggestion would be appreciated.
Oh…it is even worse than I thought. No image is displayed at all, meaning if I open old WPs the pages will always get this 500 error.
->This is really annoying!
Hi Bernd,
as far as I can tell you missed the execution of migrations, right? If so please run the migrations and everything should be fine. If you do not know how to do that please let me know how you installed your openproject.
Cheers,
Karsten
Hi!
Thanks for the feedback, this is really appreciated!
Well…ehmm…
you missed the execution of migrations, right?
Could be. Honestly I got no clue. I have manually installed OP on a debian system, is that the info you need to know?
Cheerio!
Ok, that is the info I need. So you can try to cd into the root of your openproject installation. Please try to run the following command.
RAILS_ENV=production bundle exec rake db:migrate --trace
Cheers,
Karsten
Hmm…I entered the command, but I still have the same error.
What about the output of the command. Does it say something about migrations? Did it change something?
Maybe this gives you a hint:
Ok that explains a lot. First of all I do not know why your migration ends up with an error but I can see where. The important migration for your particular problem is executed after the AddSessionsTable migration.
As you can see in the error log:
The migration important for you gets not executed. So now we know what is causing the problem. Now we have to find out why. Can you please paste more log info of the actual error, please?
Cheers,
Karsten
Ok I missed the last line about the session table already existing. Let us do something fancy here and try to fix this by doing the following:
please open a mysql connection to your mysql database end execute the following statement:
INSERT INTO schema_migrations VALUES('20140429152018')
After that please run the migrations again.
Cheers,
Karsten
Hej!
I did as you told me , now it get this, after having inserted the sql command:
Ok something is really odd with your installation. Unfortunately the migration failing is the next in line so we haven’t accomplish that much. Your data seem to be broken so we have to fix this somehow.
There are some things we can try. We could skip this migration too which might be a bad idea. Or we are lucky and by skipping it we get what we want. I suggest not to skip the migration. So we have to figure out which attachment is producing the error.
See the code for more information.
To move on with this I have to asked how experienced are you in regard to programming ruby? Can you debug this by your own when I point you in the correct direction or do you need additional help?
Cheers,
Karsten
A general advice: Please backup the data of your database now before we move on. So we are able to roll back all our changes. Better safe than sorry ;-)
Karsten
Hi!
Thanks for your support!
Hmm my Ruby skills? They are pretty much as good as my islandic skills, meaning: 0 ;-) I can only try to understand what I see, when I see a log in “Ruby”.
But: Wouldn´t it be better to skip this zombie installation, delete it and use the packaged version of OP instead? And then reimport the settings and db?
What do you think?
Bernd
Hi,
yeah that is in general a good idea but your data is broken and will also produce problems with the packager installation. So you should somehow fix this issue. If you did a backup already we could try to skip the last migration error.
What do you think?
To skip the migration you can do the following:
Insert this in the db
INSERT INTO schema_migrations VALUES('20140430125956')
and do the migration again.What do you think?
Regards,
Karsten
Oh…so this is not related to the openproject program itself, but the data is corrupt…oh…. :-(
Anyways, as I am brave and courageous I entered the commands “und siehe” I can see the old images again that are in the wiki and older WP. Great!
But it seems like all new WP do not accept to display images I still got this error 500. Still the folder/file was created and i can see the file…strange?!
Ok that is strange. Can you provide some log information on that. Without that I will not be able to help.
Hi!
Did you have a chance to take a look at the logs. Are they useful?
Cheers!
Hi,
yes I looked at it but could not find any useful information. The problem is the log is too long and there are a lot of error messages not related to our problem. Could you please just send me the log with the error in it. For example you could stop the server, clean the log and do whatever is necessary to produce the error and stop the server again.
After that the log will be small and will only include our error.
What do you think?
Cheers,
Karsten
Hi!
Yes of course you are, I didn´t think of reducing the logs, sorry that was stupid.
Anyway: When I create a new WP the upload/display of attachment seems to work perfectly now.
Thank you very much, I would have never ever found out what the problem could have been.
Best regards!