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

Update to 3.5.13 with DB migration failed #2142

Closed
jezeklu opened this issue Jun 21, 2024 · 1 comment
Closed

Update to 3.5.13 with DB migration failed #2142

jezeklu opened this issue Jun 21, 2024 · 1 comment
Labels
bug Bugs & errors found in Reposilite

Comments

@jezeklu
Copy link

jezeklu commented Jun 21, 2024

What happened?

When I update with migration, startup fails.

Version: 3.5.12 to 3.5.13
Environment: Docker

My docker compose file:

services:
  reposilite:
    image: dzikoysk/reposilite:3.5.13
    container_name: reposilite
    environment:
      JAVA_OPTS: -Xmx128M
      REPOSILITE_OPTS: --run-migrations 003
    restart: unless-stopped
    volumes:
      - /data/reposilite/:/app/data

Processes after container launch:

$ ps ax | grep reposilite
3234405 ?        Ss     0:00 runuser -u reposilite -- java -Dtinylog.writerFile.file=/var/log/reposilite/log_{date}.txt -Dtinylog.writerFile.latest=/var/log/reposilite/latest.log -Xmx128M -jar reposilite.jar --working-directory=/app/data --run-migrations 003
3234481 ?        Sl     0:02 java -Dtinylog.writerFile.file=/var/log/reposilite/log_{date}.txt -Dtinylog.writerFile.latest=/var/log/reposilite/latest.log -Xmx128M -jar reposilite.jar --working-directory=/app/data --run-migrations 003
3234579 pts/1    S+     0:00 grep --color=auto reposilite

Reposilite version

3.x

Relevant log output

reposilite  | Adding group `reposilite' (GID 999) ...
reposilite  | Done.
reposilite  | Adding system user `reposilite' (UID 999) ...
reposilite  | Adding new user `reposilite' (UID 999) with group `reposilite' ...
reposilite  | Not creating `/nonexistent'.
reposilite  | 06:41:17.527 INFO | 
reposilite  | 06:41:17.533 INFO | Reposilite 3.5.13
reposilite  | 06:41:17.533 INFO | 
reposilite  | 06:41:17.533 INFO | --- Environment
reposilite  | 06:41:17.536 INFO | Platform: 21 (Linux :: amd64)
reposilite  | 06:41:17.536 INFO | Running as: reposilite
reposilite  | 06:41:17.536 INFO | Working directory: /app/data
reposilite  | 06:41:17.536 INFO | Plugin directory: /app/data/plugins
reposilite  | 06:41:17.536 INFO | Configuration: /app/data/configuration.cdn
reposilite  | 06:41:17.537 INFO | Threads: 16 WEB / 8 IO / 1 DB
reposilite  | 06:41:17.541 INFO | Loom enabled: true
reposilite  | 06:41:17.986 INFO | HikariPool-1 - Added connection org.sqlite.jdbc4.JDBC4Connection@5b970f7
reposilite  | 06:41:18.058 INFO | 
reposilite  | 06:41:18.059 INFO | --- Loading plugins:
reposilite  | 06:41:18.237 INFO | failure, configuration, local-configuration, shared-configuration, access-token
reposilite  | 06:41:18.237 INFO | authentication, console, statistics, frontend, storage
reposilite  | 06:41:18.237 INFO | maven, javadoc, redirect, status, web
reposilite  | 06:41:18.328 INFO | 
reposilite  | 06:41:18.328 INFO | --- Local configuration
reposilite  | 06:41:18.329 INFO | Loading local configuration from local file
reposilite  | 06:41:18.333 INFO | Local configuration has been loaded from local file
reposilite  | 06:41:18.364 INFO | 
reposilite  | 06:41:18.364 INFO | --- Shared settings
reposilite  | 06:41:18.364 INFO | Loading shared configuration from remote database
reposilite  | 06:41:18.756 INFO | Domains 'authentication', 'frontend', 'maven', 'statistics', 'web' have been loaded from remote database
reposilite  | Exception in thread "main" java.util.NoSuchElementException: List is empty.
reposilite  | 	at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:221)
reposilite  | 	at org.jetbrains.exposed.sql.statements.BatchUpdateStatement.getFirstDataSet(BatchUpdateStatement.kt:20)
reposilite  | 	at org.jetbrains.exposed.sql.statements.UpdateStatement.prepareSQL(UpdateStatement.kt:33)
reposilite  | 	at org.jetbrains.exposed.sql.statements.BatchUpdateStatement.prepareSQL(BatchUpdateStatement.kt:49)
reposilite  | 	at org.jetbrains.exposed.sql.statements.Statement.prepareSQL$default(Statement.kt:36)
reposilite  | 	at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:79)
reposilite  | 	at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:292)
reposilite  | 	at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:269)
reposilite  | 	at org.jetbrains.exposed.sql.statements.Statement.execute(Statement.kt:59)
reposilite  | 	at com.reposilite.statistics.infrastructure.SqlStatisticsRepository$runFixes$3.invoke(SqlStatisticsRepository.kt:142)
reposilite  | 	at com.reposilite.statistics.infrastructure.SqlStatisticsRepository$runFixes$3.invoke(SqlStatisticsRepository.kt:119)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction$run(ThreadLocalTransactionManager.kt:324)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.access$inTopLevelTransaction$run(ThreadLocalTransactionManager.kt:1)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:371)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:379)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:370)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:279)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:379)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:249)
reposilite  | 	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:227)
reposilite  | 	at com.reposilite.statistics.infrastructure.SqlStatisticsRepository.runFixes(SqlStatisticsRepository.kt:119)
reposilite  | 	at com.reposilite.statistics.infrastructure.SqlStatisticsRepository.<init>(SqlStatisticsRepository.kt:78)
reposilite  | 	at com.reposilite.statistics.application.StatisticsComponents.statisticsRepository(StatisticsComponents.kt:39)
reposilite  | 	at com.reposilite.statistics.application.StatisticsComponents.statisticsFacade$default(StatisticsComponents.kt:42)
reposilite  | 	at com.reposilite.statistics.application.StatisticsPlugin.initialize(StatisticsPlugin.kt:45)
reposilite  | 	at com.reposilite.statistics.application.StatisticsPlugin.initialize(StatisticsPlugin.kt:34)
reposilite  | 	at com.reposilite.plugin.PluginLoader.initialize(PluginLoader.kt:48)
reposilite  | 	at com.reposilite.ReposiliteFactory.createReposilite(ReposiliteFactory.kt:87)
reposilite  | 	at com.reposilite.ReposiliteFactory.createReposilite(ReposiliteFactory.kt:36)
reposilite  | 	at com.reposilite.ReposiliteLauncherKt.createWithParameters(ReposiliteLauncher.kt:41)
reposilite  | 	at com.reposilite.ReposiliteLauncherKt.main(ReposiliteLauncher.kt:22)
@jezeklu jezeklu added the bug Bugs & errors found in Reposilite label Jun 21, 2024
@dzikoysk dzikoysk changed the title update to 3.5.13 with DB migration failed Update to 3.5.13 with DB migration failed Jun 21, 2024
@dzikoysk
Copy link
Owner

Thanks for reporting it. The migration script indeed is not fully able to convert all dates, so I've marked 3.5.13 as pre-release. Should be fixed by:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs & errors found in Reposilite
Projects
None yet
Development

No branches or pull requests

2 participants