Hello, I really appreciate you looking at this issue. It is pretty clear to me that you pinpointed the correct code extract around here <https://github.com/gocd/gocd/blob/1278474dcd8b2e90c0f19fc15098c279274141cb/db-support/db-migration/src/main/java/com/thoughtworks/go/server/database/migration/DatabaseMigrator.java#L61>, but with my limited knowledge of Java, I don't know what to make of it.
I posted 210 lines of go-server-wrapper.log on PasteBin <https://pastebin.com/U8Tfx5BF>; I hope this can help. Please let me know if you need other details On Tuesday, January 18, 2022 at 3:45:39 PM UTC+1 Aravind SV wrote: > Hello Jonathan, > > Given that the message seems to be coming from around here > <https://github.com/gocd/gocd/blob/1278474dcd8b2e90c0f19fc15098c279274141cb/db-support/db-migration/src/main/java/com/thoughtworks/go/server/database/migration/DatabaseMigrator.java#L61>, > > there could be more information in the logs. It’s hard to say what the > problem is without more information. > > My understanding was that running this tool would only write to the target > database with no impact on the source. > > That is a reasonable expectation, I feel. However, one of the reasons the > first steps in the documentation > <https://docs.gocd.org/current/installation/upgrade_to_gocd_20.5.0.html> > mentions backing up and stopping the server is to make recovery easier. I > don’t know what happens if you run this against a *running* GoCD server. > > I wonder if permissions got changed, or something like that. Won’t know > without more information from the logs. > > Cheers, > Aravind > > * From*: Jonathan Bandelier > * Subject*: [go-cd] Database migration dry run gone wrong > * To*: go-cd > * Date*: Mon, 17 Jan 2022 14:59:52 -0800 (PST) > I recently ran gocd-database-migrator (flags -insert and --progress) on > my. 20.4.0 GoCD server with its current H2 database as source and a blank > PostgreSQL instance as target. > > My understanding was that running this tool would only write to the target > database with no impact on the source. As this was meant to be a dry run > just to make sure the user on target PostgreSQL instance had the proper > privileges, I did not stop or back up GoCD before running the tool. The > tool ran without error, so I instructed the DBA to delete the target > database, planning to to the real migration later, when all is ready to > actually upgrade to 20.5.0. > > I then found plenty database-related errors showing up in the GoCD > console; I restarted the go-server service and it got worse: GoCD is no > longer able to start > > go-server-wrapper.log appears to indicate that the update is in progress: > > INFO | jvm 1 | 2022/01/17 22:18:33 | > ************************************************************************ > INFO | jvm 1 | 2022/01/17 22:18:33 | WARNING: Shutting down your > server at this point will lead to a database corruption. Please wait until > the database upgrade completes. > INFO | jvm 1 | 2022/01/17 22:18:33 | > ************************************************************************ > INFO | jvm 1 | 2022/01/17 22:18:33 | Reading change scripts from > directory /var/lib/go-server/db/h2deltas... > INFO | jvm 1 | 2022/01/17 22:18:33 | dbdeploy v2.11 > DEBUG | wrapperp | 2022/01/17 22:18:34 | Send a packet PING : ping > 00000152 > INFO | jvm 1 | 2022/01/17 22:18:34 | WrapperManager Debug: Received a > packet PING : ping 00000152 > INFO | jvm 1 | 2022/01/17 22:18:34 | WrapperManager Debug: Send a > packet PING : ping 00000152 > DEBUG | wrapperp | 2022/01/17 22:18:34 | read a packet PING : ping > 00000152 > INFO | jvm 1 | 2022/01/17 22:18:35 | Unable to create database > upgrade script for database > > Is there any way for me to get out of this mess, and bring back my H2 > database to the state it was before running the tool? Would emptying the > h2deltas folder do the trick? > > Thanks in advance for your help > > > > -- > You received this message because you are subscribed to the Google Groups > "go-cd" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/go-cd/785b0a66-c1b7-43b6-b18f-279ff7629bb7n%40googlegroups.com > > <https://groups.google.com/d/msgid/go-cd/785b0a66-c1b7-43b6-b18f-279ff7629bb7n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/d3a7ceff-0177-401a-a5cb-a0943851ffe5n%40googlegroups.com.
