space on premise docker - update from 2023.1.1 to 2023.3.1 issue

good morning, I have been trying for a few days to update a SpaceOnPremise on Docker bringing back the old version data for obvious reasons but it doesn't work.
Following the documentation I update all config files etc...
but in the end when I try to access http://localhost:8084 the conteiner goes down.
I made several attempts but the error is always the same, a problem with the database.
This is the part of the Log with the error:
 

xception: org.postgresql.util.PSQLException: ERROR: could not create unique index "permissionroles_relevantid_scope_code_type_name_unique"

Detail: Key ("relevantId", scope, code, type, name)=(0, Global, Requested, Authorizable, ) is duplicated.. Statement(s): ALTER TABLE permissionroles ADD CONSTRAINT permissionroles_relevantid_scope_code_type_name_unique UNIQUE ("relevantId", scope, code, "type", "name")

java.sql.SQLException: java.sql.BatchUpdateException: org.postgresql.util.PSQLException: ERROR: could not create unique index "permissionroles_relevantid_scope_code_type_name_unique"

Detail: Key ("relevantId", scope, code, type, name)=(0, Global, Requested, Authorizable, ) is duplicated.

at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:64)

at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:137)

at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:121)

at org.jetbrains.exposed.sql.statements.Statement.execute(Statement.kt:28)

at org.jetbrains.exposed.sql.statements.jdbc.JdbcConnectionImpl.executeInBatch(JdbcConnectionImpl.kt:112)

at org.jetbrains.exposed.sql.Transaction.execInBatch(Transaction.kt:129)

at circlet.platform.a.m.MigrationsOrder.a(MigrationsOrder.java:69)

at circlet.platform.a.m.MigrationsOrder.a(MigrationsOrder.java:13)

at circlet.platform.a.m.MigrationsOrder.a(MigrationsOrder.java:107)

at circlet.platform.a.m.w$ab.a(w$ab.java:2)

at circlet.platform.a.m.w$ab.invoke(w$ab.java:4)

at circlet.platform.a.j.ClusterSingletonTransactionImpl$g$a.invoke(ClusterSingletonTransactionImpl$g$a.java:2)

at circlet.platform.a.m.w$d$a.invoke(w$d$a.java:4)

at circlet.platform.a.m.bn$a$b$c$d$e.a(bn$a$b$c$d$e.java:1)

at circlet.platform.a.m.bn$a$b$c$d$e.invoke(bn$a$b$c$d$e.java:2)

at circlet.platform.a.m.bn$k$a.invoke(bn$k$a.java:17)

at circlet.platform.a.n.z.a(z.java:82)

at circlet.platform.a.m.bn$k.a(bn$k.java:42)

at circlet.platform.a.m.bn$k.invoke(bn$k.java:1)

at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction$run(ThreadLocalTransactionManager.kt:198)

at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.access$inTopLevelTransaction$run(ThreadLocalTransactionManager.kt:1)

at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:221)

at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:229)

at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:220)

at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction$default(ThreadLocalTransactionManager.kt:179)

at circlet.platform.a.m.bn.a(bn.java:154)

at circlet.platform.a.m.bn.b(bn.java:266)

at circlet.platform.a.m.bn$a$b$c$d.a(bn$a$b$c$d.java:7)

at circlet.platform.a.m.bn$a$b$c$d.invoke(bn$a$b$c$d.java:5)

at libraries.klogging.MDC.syncWithImplementation(MDC.kt:27)

at libraries.klogging.MDCKt.syncWith(MDC.kt:25)

at libraries.klogging.MDCKt.syncWith(MDC.kt:22)

at circlet.platform.a.m.bn$a$b$c.a(bn$a$b$c.java:4)

at circlet.platform.a.m.bn$a$b$c.invoke(bn$a$b$c.java:3)

at circlet.platform.a.m.av$b.a(av$b.java:2)

at circlet.platform.a.m.av$b.invoke(av$b.java:1)

at circlet.platform.a.m.TxPool$a.a(TxPool$a.java:10)

at circlet.platform.a.m.TxPool$a.a(TxPool$a.java:30)

at circlet.platform.a.m.TxPool$a$c.invokeSuspend(TxPool$a$c.java:10)

at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)

at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)

at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)

at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)

at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)

at circlet.platform.a.m.TxPool$a.a(TxPool$a.java:16)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)


 

thank you

0
6 comments
Hello Fabio

The error you see points to issues with merging two databases. PostgreSQL is unable to create the index while another index with the same name already exists. To understand why it happens, we need additional information. Please provide the following:

1. Error logs from your Space Docker container.
2. Error logs from your PostgreSQL Docker container.
3. Some details on how you upgrade. Do you create a separate directory for the new version of Space? The error shown may occur if you install a new version into the same directory as the current version.
0

i think i am doing something wrong.
i have an instance of space on docker version 2023.1.1
i want to upgrade to 2023.3.1 while keeping the current database.

these are my steps:
- i remove the containers version 2023.1.1
- i retrieve the config files version 2023.3.1 and remove the containers from 2023.3.1
- I align the config and docker-compose.yml files with the old files from verision 2023.1.1
- I make a folder with the new docker-compose.yml, config file and old database and start the new containers 
 

0
Fabio

Your upgrade method is similar to the one we recommend in the documentation. However, it is better not to remove the old version until you are sure the new version works as intended.

What we recommend doing is:

1. Create a new directory for 2023.3.1. Go to that directory.
2. Download the latest docker-compose.yml file.
3. Align docker-compose.yml from 2023.3.1 with docker-compose.yml from 2023.1.1. If volumes for postgres in the new docker-compose.yaml are the same as in the previous version — you will use your old database.
4. Enable customization for 2023.3.1 as described here: https://www.jetbrains.com/help/space/configure-space-for-docker-compose-production-environment.html#customize-space-service-configuration.
5. Create default configs for 2023.3.1.
6. Align config files: copy parameters from 2023.1.1 to space.on-premises.conf, packages.on-premises.conf, and vcs.on-premises.conf of 2023.3.1. Copying config files from 2023.3.1 to the new version may not work.
7. Stop the old Space instance and start the new one.

The process is described here:  https://www.jetbrains.com/help/space/migrate-from-earlier-versions.html#how-to-migrate. Please make sure you are following it carefully.

If you are sure you did everything as described, please attach error logs for Space and PostgreSQL containers — they will help us understand why you face the 
PSQLException.
0

I tried again by doing as you say but nothing changed.
attached two logs of space and postgres and an archive containing the folder structure and config files of the old and new version (empty data folders)

https://drive.google.com/file/d/19QUUsvcDdiNH1Ra7-GP3oyyeJ7J5uMyn/view?usp=drive_link

https://drive.google.com/file/d/1A0JwCTFVSWkEy-u5C-R3sXys3OQMCWeF/view?usp=drive_link

https://drive.google.com/file/d/1KYGutKoOF3oUN9NUC7OEbPd9g5y8msB8/view?usp=drive_link

 

 

0

I solved.
if i upgrade 2023.1 to 2023.2 and afterwards upgrade to 2023.3.1 it works.
thank you
 

0
Fabio

I'm glad to know it worked!

I will close this ticket, but feel free to reopen it if you have more questions.
0

Please sign in to leave a comment.