Content
You are here:
[solved/very ugly/ still open]Manual udpdate 4 -> 4.2 failed: "StandardError: An error has occurred, all later migrations canceled"
Added by Bernd Müller about 9 years ago
Hi!
Me again having issues updating OP :-/
I tried to follow this how-to.
When I execute the command RAILS_ENV="production" bundle exec rake db:migrate
I get
Migrating attachment 99/117 (150511111744_deleteconfig.PNG) Migrating attachment 100/117 (150615164549_NO_CONNECTION_sERVER.PNG) Migrating attachment 101/117 () rake aborted! StandardError: An error has occurred, all later migrations canceled: Invalid argument @ sys_fail2 - (/home/openproject/openproject/files, /home/openproject/openproject/files/files)/home/openproject/openproject/db/migrate/20141215104802_migrate_attachments_to_carrier_wave.rb:100:in `migrate_attachment'
Can someone please tell me what problem I am encoutering? And how to solve this.
Any assistance is appreciated!
Cheers
PS: As this manual update is always a pain in the a****, I wonder what steps need to be taken to switch to the packaged version of OP?
Replies (10)
Maybe this is related to the problem I had here
I have taken a look at the database and I found this here
My guess is that the missing disk_filename in the db could be the cause of that issue
Hmmm….I kind of solved it. But this is really a crippled and ugly hack
.
What I did was following: I added foobar.png into to the missing “disk_filename” and then I could run the “migrate” command. But after that I wasn´t able to add attachments into OP workpackages. So I allowed “NULL” to the “disk_filename” structure and now I can add attachments. Still the added attachments have no entries in “disk_filename”. Meaning that there is still something wrong in OP…
How can I convince OP to create correct “disk_filename”? My guess is that OP is somehow not capable of creating a proper timestamp for the files…What can be done?
Hi Bernd,
this really looks like it’s connected to the other error you got/the other forum post.
It seems like your installation is somewhat broken. The easiest would be to set it all up again, maybe with a packaged based installation. Switching now to the packaged based installation unfortunately is not an option since the database would still be broken. If you could migrate everything to a new installation that would be the easiest.
If not, we have to fix the migrations. Seems like it was no good idea to skip the migration. We should run the migrations again and fix the errors that occur during that migrations. If you want to try this, please run
DELETE FROM schema_migrations WHERE version='20140430125956'
and run the migrations again. Then we will have to fix the errors that come up when you do so.Sorry that I do not have a better answer for you.
Best,
Jonas
Hi Jonas!
Thanks for your reply, I am currently working some other things. But I will get to this issue this week.
Cheers
Ok, so let´s get this working…
First question before I do anything
DELETE FROM schema_migrations WHERE version='20140430125956'
, what will happen when I enter this? Will my Openproject installation stop working? Meaning should I backup my DB…or is this a save command?Hi Bernd,
backing up is always good! :)
Rails saves what migrations it’s run in that table. If you delete the relevant migration-number from it the migration will be run again. So that should be all.
But anyway, a backup always is a good thing.
Best,
Jonas
Hey!
So, I made the backup and I tried the migration again:
Hmmm…what now, looks a bit broken? :-/
Hi Bernd,
it is really hard for me to tell what the error might be because I don’t exactly know, what you did. Could try again to list what actions you have taken? What version did work, what migration did not work and what migration you skipped etc.
Thanks,
Jonas
Hi!
I am not sure I think that the migration from version 3.* to 4 made the system unstable, but I have no notes what version was the last one that worked.
Now, my idea to solve that problem would be to install the packaged version and to transfer the data step by step.
But as we already know the data is somehow corrupt…hmm…do you think that this could be doable?