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

Error while upgrading database to 0.33.0 #1436

Closed
LightTemplar opened this issue Mar 6, 2022 · 26 comments
Closed

Error while upgrading database to 0.33.0 #1436

LightTemplar opened this issue Mar 6, 2022 · 26 comments

Comments

@LightTemplar
Copy link

LightTemplar commented Mar 6, 2022

I have just pulled the new 0.33.0 docker containers and after starting them I can't connect to the website and I see the following in logs.

2022.03.06 20:38:08:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate - Running db migrations...
2022.03.06 20:38:08:0001 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate - Using migration locations: List(classpath:db/migration/postgresql, classpath:db/migration/common)
2022.03.06 20:38:08:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.2 by Redgate
2022.03.06 20:38:08:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.2
2022.03.06 20:38:08:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - 
2022.03.06 20:38:08:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:postgresql://h.anisfeld.com:12432/docspell54 (PostgreSQL 14.2)
2022.03.06 20:38:08:0006 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 57 migrations (execution time 00:00.066s)
2022.03.06 20:38:08:0007 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": 1.32.2
2022.03.06 20:38:08:0008 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version "1.33.0 - reorganize file ids"
2022.03.06 20:38:08:0009 [io-comp...] [INFO ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: table "file_migration_temp" does not exist, skipping
2022.03.06 20:38:09:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: table "obsolete_files" does not exist, skipping
2022.03.06 20:38:09:0001 [io-comp...] [ERROR] org.flywaydb.core.internal.command.DbMigrate - Migration of schema "public" to version "1.33.0 - reorganize file ids" failed! Changes successfully rolled back.
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V1.33.0__reorganize_file_ids.sql failed
-------------------------------------------------
SQL State  : 23502
Error Code : 0
Message    : ERROR: null value in column "file_id" of relation "filechunk" violates not-null constraint
  Detail: Failing row contains (null, 0, 524288, \x255044462d312e340a25c6cdcdb50a312030206f626a203c3c202f54797065...).
Location   : db/migration/postgresql/V1.33.0__reorganize_file_ids.sql (/opt/file:/opt/docspell-restserver-0.33.0/lib/com.github.eikek.docspell-store-0.33.0.jar!/db/migration/postgresql/V1.33.0__reorganize_file_ids.sql)
Line       : 142
Statement  : -- update chunks
update filechunk
  set file_id = (select new_file
                 from file_migration_temp
                 where original_file = file_id and filechunk.file_id is not null)

	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:385)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:275)
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
	at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:274)
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:247)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
	at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
	at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
	at docspell.store.migrate.FlywayMigrate$.$anonfun$run$1(FlywayMigrate.scala:41)
	at delay @ docspell.store.migrate.FlywayMigrate$.run(FlywayMigrate.scala:21)
	at map @ docspell.store.impl.StoreImpl.migrate(StoreImpl.scala:31)
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V1.33.0__reorganize_file_ids.sql failed
-------------------------------------------------
SQL State  : 23502
Error Code : 0
Message    : ERROR: null value in column "file_id" of relation "filechunk" violates not-null constraint
  Detail: Failing row contains (null, 0, 524288, \x255044462d312e340a25c6cdcdb50a312030206f626a203c3c202f54797065...).
Location   : db/migration/postgresql/V1.33.0__reorganize_file_ids.sql (/opt/file:/opt/docspell-restserver-0.33.0/lib/com.github.eikek.docspell-store-0.33.0.jar!/db/migration/postgresql/V1.33.0__reorganize_file_ids.sql)
Line       : 142
Statement  : -- update chunks
update filechunk
  set file_id = (select new_file
                 from file_migration_temp
                 where original_file = file_id and filechunk.file_id is not null)

	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:275)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:222)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:126)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:69)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:58)
	at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:57)
	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:377)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:275)
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
	at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:274)
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:247)
	at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
	at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:69)
	at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:99)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
	at docspell.store.migrate.FlywayMigrate$.$anonfun$run$1(FlywayMigrate.scala:41)
	at cats.effect.IOFiber.runLoop(IOFiber.scala:358)
	at cats.effect.IOFiber.execR(IOFiber.scala:1327)
	at cats.effect.IOFiber.run(IOFiber.scala:139)
	at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:549)
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "file_id" of relation "filechunk" violates not-null constraint
  Detail: Failing row contains (null, 0, 524288, \x255044462d312e340a25c6cdcdb50a312030206f626a203c3c202f54797065...).
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286)
	at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:201)
	at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:95)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:210)
�
@LightTemplar LightTemplar changed the title Error while upgrading database Error while upgrading database to 0.33.0 Mar 6, 2022
@eikek
Copy link
Owner

eikek commented Mar 7, 2022

Oh no! It is probably chunks that are not referenced anymore. I think we need to run some sql to move/delete these and then you need to restore a backup, run the "patching sql" again and then try another upgrade. Can you first send me the output of \d when at postgresql shell?

@LightTemplar
Copy link
Author

You know, they say: there are two kinds of people: those, who do backups, and those who don't do it yet. Yes, I was still in the second type, though automatic backups were on my todo list :))

the output of \d in the postgres shell is following:

                     List of relations
 Schema |            Name             |   Type   |  Owner   
--------+-----------------------------+----------+----------
 public | attachment                  | table    | docspell
 public | attachment_archive          | table    | docspell
 public | attachment_preview          | table    | docspell
 public | attachment_source           | table    | docspell
 public | attachmentmeta              | table    | docspell
 public | classifier_model            | table    | docspell
 public | classifier_setting          | table    | docspell
 public | client_settings_collective  | table    | docspell
 public | client_settings_user        | table    | docspell
 public | collective                  | table    | docspell
 public | collective_password         | table    | docspell
 public | contact                     | table    | docspell
 public | custom_field                | table    | docspell
 public | custom_field_value          | table    | docspell
 public | empty_trash_setting         | table    | docspell
 public | equipment                   | table    | docspell
 public | filechunk                   | table    | docspell
 public | filemeta                    | table    | docspell
 public | flyway_schema_history       | table    | docspell
 public | folder                      | table    | docspell
 public | folder_member               | table    | docspell
 public | internal_setting            | table    | docspell
 public | invitation                  | table    | docspell
 public | item                        | table    | docspell
 public | item_proposal               | table    | docspell
 public | item_share                  | table    | docspell
 public | job                         | table    | docspell
 public | jobgroupuse                 | table    | docspell
 public | joblog                      | table    | docspell
 public | joblog_counter_seq          | sequence | docspell
 public | node                        | table    | docspell
 public | notification_channel_gotify | table    | docspell
 public | notification_channel_http   | table    | docspell
 public | notification_channel_mail   | table    | docspell
 public | notification_channel_matrix | table    | docspell
 public | notification_hook           | table    | docspell
 public | notification_hook_channel   | table    | docspell
 public | notification_hook_event     | table    | docspell
 public | organization                | table    | docspell
 public | periodic_task               | table    | docspell
 public | person                      | table    | docspell
 public | pubsub                      | table    | docspell
 public | query_bookmark              | table    | docspell
 public | rememberme                  | table    | docspell
 public | sentmail                    | table    | docspell
 public | sentmailitem                | table    | docspell
 public | source                      | table    | docspell
 public | tag                         | table    | docspell
 public | tagitem                     | table    | docspell
 public | tagsource                   | table    | docspell
 public | totp                        | table    | docspell
 public | user_                       | table    | docspell
 public | useremail                   | table    | docspell
 public | userimap                    | table    | docspell
(54 rows)

@eikek
Copy link
Owner

eikek commented Mar 7, 2022

Ok - yes backups are really important - but only if you need them :) We should be able to solve it without, but I would do a backup right now. Not sure how comfortable you are with postgres, here would be some hints when using docker.

The the rough idea is now to first look at what state your database is, then do the migration manually and finally insert a row in flyway_schema_history to mark the migration as "executed".

I would need the outputs of the following things:

  • select * from flyway_schema_history
  • select count(*) from filemeta where file_id like '%/%'
  • select count(*) from filemeta where file_id not like '%/%'
  • ^^ same (previous two selects) for filechunk table

You can also put it all in separate files and send me an e-mail.

@LightTemplar
Copy link
Author

I'm not that comfortable with it, but I'm learning, while I'm doing. And that link helped too, thanks!

I've sent you the results of queries per e-mail.

@eikek
Copy link
Owner

eikek commented Mar 8, 2022

Thanks! It looks like the database is in a good state, of the previous version. So if you want you can run the previous version for the time being. I'll take a closer look and come back with instructions we can try out.

@LightTemplar
Copy link
Author

Thank you!
The previous version seems working well, though it looks like a part of docs are gone. As I remember the last time I saw overall statistics: there were around 240 docs and now there are 188. Other data are there.
And I have all original PDFs, so it won't be a big problem.

@eikek
Copy link
Owner

eikek commented Mar 8, 2022

That is very strange then. The failed migration did not touch the item table. If the transaction would not have been rolled back properly (but it looked to me as if this was ok), then you could see documents without preview images or missing files in them. But I can't explain how it could have affected the number of items.

@eikek
Copy link
Owner

eikek commented Mar 10, 2022

If you are ready to start, first create a dump 😄 Then I think we can start by applying the migration up to the point that failed. That would be running these statements:

begin;

drop table if exists file_migration_temp;
create table file_migration_temp (
  id bigserial primary key,
  original_file varchar(254) not null unique,
  cid varchar(254) not null,
  category varchar(254) not null,
  new_file varchar(254) not null unique
);

-- Source files
insert into file_migration_temp (original_file, cid, category, new_file)
  select
    rs.file_id as original_file,
    i.cid,
    'attachmentsource' as category,
    i.cid || '/attachmentsource/' || rs.file_id as new_file
  from attachment_source rs
  inner join attachment ra on rs.id = ra.attachid
  inner join item i on ra.itemid = i.itemid
;

-- Archive files
insert into file_migration_temp (original_file, cid, category, new_file)
  select distinct
    rs.file_id as original_file,
    i.cid,
    'attachmentsource' as category,
    i.cid || '/attachmentsource/' || rs.file_id as new_file
  from attachment_archive rs
  inner join attachment ra on rs.id = ra.attachid
  inner join item i on ra.itemid = i.itemid
;

-- Converted files
insert into file_migration_temp (original_file, cid, category, new_file)
  select
    ra.filemetaid as original_file,
    i.cid,
    'attachmentconvert' as category,
    i.cid || '/attachmentconvert/' || ra.filemetaid as new_file
  from attachment_source rs
  inner join attachment ra on rs.id = ra.attachid
  inner join item i on ra.itemid = i.itemid
  where rs.file_id <> ra.filemetaid
;

-- Preview image
insert into file_migration_temp (original_file, cid, category, new_file)
  select
    ap.file_id as original_file,
    i.cid,
    'previewimage' as category,
    i.cid || '/previewimage/' || ap.file_id as new_file
  from attachment_preview ap
  inner join attachment ra on ra.attachid = ap.id
  inner join item i on i.itemid = ra.itemid
  order by id
;

-- classifier
insert into file_migration_temp (original_file, cid, category, new_file)
  select
    file_id as original_file,
    cid,
    'classifier' as category,
    cid || '/classifier/' || file_id as new_file
  from classifier_model
;


-- save obsolete/orphaned files
drop table if exists obsolete_files;
create table obsolete_files(
  file_id varchar(254) not null,
  mimetype varchar(254) not null,
  length bigint not null,
  checksum varchar(254) not null,
  created timestamp not null
);

with
  missing_ids as (
    select file_id from filemeta
    except
    select original_file as file_id from file_migration_temp)
insert into obsolete_files (file_id, mimetype, length, checksum, created)
  select file_id, mimetype, length, checksum, created from filemeta
  where file_id in (select file_id from missing_ids)
;

Then please execute the following and post or send me the results:

   with
      fchunk_files as (select 'chunk files all' as label, count(distinct file_id) as n from filechunk),
      fmeta_files as (select 'meta all' as label, count(*) as n from filemeta),
      linked_files as (select 'to migrate files',  count(*) as n from file_migration_temp),
      obsolete as (select 'obsolete files', count(*) as n from obsolete_files),

      meta_no_chunks as (select 'meta no chunks' as label, count(file_id) as n from filemeta where file_id not in (select file_id from filechunk)),
      chunk_no_meta as (select 'chunk no meta' as label, count(file_id) as n from filechunk where file_id not in (select file_id from filemeta)),

      linked_chunks as (select 'to migrate chunks', count(distinct file_id) as n from filechunk where file_id in (select original_file from file_migration_temp)),
      unlinked_chunks as (select 'not to migrate chunks', count(distinct file_id) as n from filechunk where file_id not in (select original_file from file_migration_temp)),
      obsolete_chunks as (select 'obsolete chunks', count(distinct file_id) as n from filechunk where file_id in (select file_id from obsolete_files)),

      orphaned_chunks as (select 'orphaned chunks', count(distinct file_id) from filechunk
           where file_id not in (select original_file from file_migration_temp)
           and file_id not in (select file_id from obsolete_files))

    select * from fchunk_files
    union
    select * from fmeta_files
    union
    select * from linked_files
    union
    select * from obsolete
    union
    select * from meta_no_chunks
    union
    select * from chunk_no_meta
    union
    select * from linked_chunks
    union
    select * from unlinked_chunks
    union
    select * from obsolete_chunks
    union
    select * from orphaned_chunks
  ;

The transaction was started with the first begin; statement. If you run rollback; everything should be as before and we could re-run the above before doing the next steps.

@eikek
Copy link
Owner

eikek commented Mar 13, 2022

I think the problem are the "orhpaned chunks". I expect that the query would return a number greater than 0 for these. That's why the migration fails. Contrary to what I wrote above, I think it's easier to note the ids of these chunks and delete them. AFter this the migration would run on next startup.

Make sure you are in the state as defined at the end of the previous comment and that you have existing orphaned chunks.

  1. Get the ids of the chunks we need to delete:
    select distinct file_id from filechunk
      where file_id not in (select original_file from file_migration_temp)
      and file_id not in (select file_id from obsolete_files)
    Note the IDs down (copy into some text editor). If they are really many, please respond - I'm assuming that there are a few orphaned chunks only.
  2. Rollback the current transaction:
    rollback;
  3. Delete the chunks:
    delete from filechunk where file_id in ('x1', 'x2');
    Replace x1 and x2 with the IDs from step 1. Add more ids if you had more.
  4. Start Docspell (0.33.0) the migration should now succeed

@LightTemplar
Copy link
Author

The result of that query was:

"meta no chunks"	0
"meta all"	928
"chunk files all"	931
"orphaned chunks"	3
"chunk no meta"	402
"obsolete files"	0
"obsolete chunks"	0
"to migrate files"	928
"to migrate chunks"	928
"not to migrate chunks"	3

Then deleting of those 3 IDs resulted in DELETE 402. And after upgrading of containers up to 0.33.0 all services looks started and working!

Very thanks for all this help!

@eikek eikek pinned this issue Mar 15, 2022
@eikek
Copy link
Owner

eikek commented Mar 15, 2022

Thanks for reporting back! I pin this issue for a while, so it's easier to discover should others run into this as well.

@mardom1
Copy link

mardom1 commented Mar 15, 2022

I also ran into this error while trying to update, after which I rolled-back.

Will this fix be included in a future version, so that one does not have to meddle with the database manually? Or maybe a maintenance script to delete orphaned chunks?

@LightTemplar
Copy link
Author

If it's possible to skip 0.33.0, marking it buggy and letting users upgrade direct to 0.34.0, then, I think, including the fix in the future version is user friendlier.

@eikek
Copy link
Owner

eikek commented Mar 15, 2022

Yes, good point. I can add a db migration to fix this for the next release. I wanted first understand the problem a bit more. It is strange that my db doesn't have this problem.

I don't know how many people are affected by this, so not sure if it's worth the effort to create a dedicated maintenance script. Well … the script is almost there - only need to copy the stuff from above into a file and let it run :) It's good that postgres supports transactions for ddl, I don't think mariadb can do this… the script could be a bit different then.

@TheFehr
Copy link

TheFehr commented Mar 15, 2022

I did not try to migrate before using your cleanup script. But I also deleted 1 obsolete chunk and then pulled the new docker image.

@eikek
Copy link
Owner

eikek commented Mar 16, 2022

If it was an "orphaned" chunk, then you would have run into this issue… I think the idea from @LightTemplar is good: to recommend waiting for the next release. I can adjust the release notes accordingly

@TheFehr
Copy link

TheFehr commented Mar 16, 2022

Ah yes orphaned. But yeah for people not willing to manualy clean up skipping might be a good option

@eikek
Copy link
Owner

eikek commented Mar 19, 2022

I pushed a fix now that is included in the current nightly. If someone is brave enough to test it on their data, that would be great! I can only run it against artificially created data. I would create a release asap then to get this out of the way :-) 🙏🏼

@mardom1
Copy link

mardom1 commented Mar 19, 2022

I have set up a quick test environment using a copy of my database. Does not seem to work, unfortunately :/

joex_1        | 2022.03.19 21:15:16:0010 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1.32.2
joex_1        | 2022.03.19 21:15:16:0011 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Migrating schema `docspell` to version "1.33.0 - reorganize file ids"
joex_1        | 2022.03.19 21:15:17:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.file_migration_temp' (SQL State:  - Error Code: 1051)
joex_1        | 2022.03.19 21:15:26:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.obsolete_files' (SQL State:  - Error Code: 1051)
joex_1        | 2022.03.19 21:19:14:0000 [io-comp...] [ERROR] org.flywaydb.core.internal.command.DbMigrate - Migration of schema `docspell` to version "1.33.0 - reorganize file ids" failed! Please restore backups and roll back database and code!
joex_1        | org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V1.33.0__reorganize_file_ids.sql failed
joex_1        | -------------------------------------------------
joex_1        | SQL State  : 23000
joex_1        | Error Code : 1048
joex_1        | Message    : (conn=14) Column 'file_id' cannot be null
joex_1        | Location   : db/migration/mariadb/V1.33.0__reorganize_file_ids.sql (/opt/file:/opt/docspell-joex-0.34.0-SNAPSHOT/lib/com.github.eikek.docspell-store-0.34.0-SNAPSHOT.jar!/db/migration/mariadb/V1.33.0__reorganize_file_ids.sql)
joex_1        | Line       : 140
joex_1        | Statement  : -- update chunks
joex_1        | update filechunk
joex_1        |   set file_id = (select new_file
joex_1        |                  from file_migration_temp
joex_1        |                  where original_file = file_id and filechunk.file_id is not null)
joex_1        |
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:385)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:275)
joex_1        |         at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:274)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:247)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
joex_1        |         at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:58)
joex_1        |         at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:152)
joex_1        |         at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
joex_1        |         at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
joex_1        |         at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
joex_1        |         at docspell.store.migrate.FlywayMigrate.$anonfun$run$5(FlywayMigrate.scala:53)
joex_1        |         at blocking @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.exists(FilesPlatform.scala:204)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$run$4(FlywayMigrate.scala:53)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$run$2(FlywayMigrate.scala:52)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.createFlyway(FlywayMigrate.scala:36)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$run$1(FlywayMigrate.scala:51)
joex_1        |         at blocking @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.exists(FilesPlatform.scala:204)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$runFixups$4(FlywayMigrate.scala:65)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$runFixups$2(FlywayMigrate.scala:64)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        | Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V1.33.0__reorganize_file_ids.sql failed
joex_1        | -------------------------------------------------
joex_1        | SQL State  : 23000
joex_1        | Error Code : 1048
joex_1        | Message    : (conn=14) Column 'file_id' cannot be null
joex_1        | Location   : db/migration/mariadb/V1.33.0__reorganize_file_ids.sql (/opt/file:/opt/docspell-joex-0.34.0-SNAPSHOT/lib/com.github.eikek.docspell-store-0.34.0-SNAPSHOT.jar!/db/migration/mariadb/V1.33.0__reorganize_file_ids.sql)
joex_1        | Line       : 140
joex_1        | Statement  : -- update chunks
joex_1        | update filechunk
joex_1        |   set file_id = (select new_file
joex_1        |                  from file_migration_temp
joex_1        |                  where original_file = file_id and filechunk.file_id is not null)
joex_1        |
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:275)
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:222)
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:126)
joex_1        |         at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:69)
joex_1        |         at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:58)
joex_1        |         at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27)
joex_1        |         at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:57)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:377)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:275)
joex_1        |         at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:274)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:247)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
joex_1        |         at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:58)
joex_1        |         at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:152)
joex_1        |         at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
joex_1        |         at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
joex_1        |         at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
joex_1        |         at docspell.store.migrate.FlywayMigrate.$anonfun$run$5(FlywayMigrate.scala:53)
joex_1        |         at cats.effect.unsafe.WorkerThread.blockOn(WorkerThread.scala:591)
joex_1        |         at scala.concurrent.package$.blocking(package.scala:124)
joex_1        |         at cats.effect.IOFiber.runLoop(IOFiber.scala:967)
joex_1        |         at cats.effect.IOFiber.asyncContinueSuccessfulR(IOFiber.scala:1338)
joex_1        |         at cats.effect.IOFiber.run(IOFiber.scala:140)
joex_1        |         at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:523)
joex_1        | Caused by: java.sql.SQLIntegrityConstraintViolationException: (conn=14) Column 'file_id' cannot be null
joex_1        |         at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:278)
joex_1        |         at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:358)
joex_1        |         at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:133)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:807)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:746)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:665)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:608)
joex_1        |         at org.mariadb.jdbc.Statement.executeInternal(Statement.java:906)
joex_1        |         at org.mariadb.jdbc.Statement.execute(Statement.java:1031)
joex_1        |         at org.mariadb.jdbc.Statement.execute(Statement.java:441)
joex_1        |         at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:201)
joex_1        |         at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:95)
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:210)
joex_1        |         ... 27 more

@eikek
Copy link
Owner

eikek commented Mar 19, 2022

Thank you a lot for testing! Could you double check, whether the image was fetched anew? The logs look a little bit like the previous ones. I changed them slightly, there should be lines like !!! Running fixup migrations (they could be just omitted here ofc). When starting up, the banner shows the commit hash from the build, maybe this can help, or the /api/info/version endpoint.

@mardom1
Copy link

mardom1 commented Mar 20, 2022

I will check later. But in the Location part of the error above, it does say something about /opt/file:/opt/docspell-joex-0.34.0-SNAPSHOT. I also pulled the images manually after adjusting the docker compose.

@eikek
Copy link
Owner

eikek commented Mar 20, 2022

Thanks for checking, it's just to be extra sure. The nightly version is always 0.34.0-SNAPSHOT until the next release. It will be updated with every commit to master, but the version stays the same. If you can, would be great to see a more lines of the log output before the error, maybe from right after the banner (joex or restserver). In the new version, two migrations are being run, that should be in the logs (need to see what the first one didi). Thanks 🙏🏼

@mardom1
Copy link

mardom1 commented Mar 21, 2022

Sorry for the delay. I ran it again, here are the full logs:

joex_1        | Mar 21, 2022 7:54:54 AM org.jline.utils.Log logr
joex_1        | WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
joex_1        | 2022.03.21 07:54:52:531 io-compute-1 INFO docspell.config.ConfigFactory.default:36
joex_1        |     Using config file: /opt/docspell.conf
restserver_1  | Mar 21, 2022 8:54:55 AM org.jline.utils.Log logr
restserver_1  | WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
restserver_1  | 2022.03.21 08:54:53:902 io-compute-1 INFO docspell.config.ConfigFactory.default:36
restserver_1  |     Using config file: /opt/docspell.conf
joex_1        | 2022.03.21 07:54:57:0000 [io-comp...] [INFO ] docspell.joex.Main.run:37 -
joex_1        | ***>  ______                          _ _
joex_1        | ***>  |  _  \                        | | |
joex_1        | ***>  | | | |___   ___ ___ _ __   ___| | |
joex_1        | ***>  | | | / _ \ / __/ __| '_ \ / _ \ | |
joex_1        | ***>  | |/ / (_) | (__\__ \ |_) |  __/ | |
joex_1        | ***>  |___/ \___/ \___|___/ .__/ \___|_|_|
joex_1        | ***>                      | |
joex_1        | ***>                      |_| v0.34.0-SNAPSHOT (#880b1fcf)
joex_1        | ***>  << JOEX >>
joex_1        | ***>  Id:       joex
joex_1        | ***>  Base-Url: http://joex:7878
joex_1        | ***>  Database: jdbc:mariadb://mysql:3306/docspell
joex_1        | ***>  Fts:      http://solr:8983/solr/docspell
joex_1        | ***>  Config:   /opt/docspell.conf
joex_1        | ***>  FileRepo: DefaultDatabase(true)
joex_1        | ***>
restserver_1  | 2022.03.21 08:55:01:196 io-compute-1 WARN docspell.restserver.ConfigFile.generateSecretIfEmpty:57
restserver_1  |     No serverSecret specified. Generating a random one. It is recommended to add a server-secret in the config file.
joex_1        | 2022.03.21 07:55:02:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/fixups/mariadb, classpath:db/fixups/common)
joex_1        | 2022.03.21 07:55:02:0001 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.runFixups:64 - !!! Running fixup migrations
restserver_1  | 2022.03.21 08:55:03:0000 [io-comp...] [INFO ] docspell.restserver.Main.run:34 -
restserver_1  | ***>  ______                          _ _
restserver_1  | ***>  |  _  \                        | | |
restserver_1  | ***>  | | | |___   ___ ___ _ __   ___| | |
restserver_1  | ***>  | | | / _ \ / __/ __| '_ \ / _ \ | |
restserver_1  | ***>  | |/ / (_) | (__\__ \ |_) |  __/ | |
restserver_1  | ***>  |___/ \___/ \___|___/ .__/ \___|_|_|
restserver_1  | ***>                      | |
restserver_1  | ***>                      |_| v0.34.0-SNAPSHOT (#880b1fcf)
restserver_1  | ***>  << REST Server >>
restserver_1  | ***>  Id:       rest1
restserver_1  | ***>  Base-Url: http://192.168.178.25:7880
restserver_1  | ***>  Database: jdbc:mariadb://mysql:3306/docspell
restserver_1  | ***>  Fts:      http://solr:8983/solr/docspell
restserver_1  | ***>  Config:   /opt/docspell.conf
restserver_1  | ***>  FileRepo: DefaultDatabase(true)
restserver_1  | ***>
joex_1        | 2022.03.21 07:55:02:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
joex_1        | 2022.03.21 07:55:02:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
joex_1        | 2022.03.21 07:55:02:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
joex_1        | 2022.03.21 07:55:02:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
joex_1        | 2022.03.21 07:55:02:0006 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 0 migrations (execution time 00:00.012s)
joex_1        | 2022.03.21 07:55:02:0007 [io-comp...] [WARN ] org.flywaydb.core.internal.command.DbValidate - No migrations found. Are your locations set up correctly?
joex_1        | 2022.03.21 07:55:04:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table `docspell`.`flyway_fixup_history` with baseline ...
joex_1        | 2022.03.21 07:55:12:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbBaseline - Successfully baselined schema with version: 1
joex_1        | 2022.03.21 07:55:12:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1
joex_1        | 2022.03.21 07:55:12:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Schema `docspell` is up to date. No migration necessary.
joex_1        | 2022.03.21 07:55:12:0003 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/migration/mariadb, classpath:db/migration/common)
joex_1        | 2022.03.21 07:55:12:0004 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.run:52 - !!! Running main migrations
joex_1        | 2022.03.21 07:55:12:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
joex_1        | 2022.03.21 07:55:12:0006 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
joex_1        | 2022.03.21 07:55:12:0007 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
joex_1        | 2022.03.21 07:55:12:0008 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
joex_1        | 2022.03.21 07:55:12:0009 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 61 migrations (execution time 00:00.518s)
joex_1        | 2022.03.21 07:55:12:0010 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1.32.2
joex_1        | 2022.03.21 07:55:12:0011 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Migrating schema `docspell` to version "1.33.0 - reorganize file ids"
joex_1        | 2022.03.21 07:55:13:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.file_migration_temp' (SQL State:  - Error Code: 1051)
joex_1        | 2022.03.21 07:55:21:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.obsolete_files' (SQL State:  - Error Code: 1051)
restserver_1  | 2022.03.21 08:55:26:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/fixups/mariadb, classpath:db/fixups/common)
restserver_1  | 2022.03.21 08:55:28:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.runFixups:64 - !!! Running fixup migrations
restserver_1  | 2022.03.21 08:55:28:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
restserver_1  | 2022.03.21 08:55:28:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
restserver_1  | 2022.03.21 08:55:28:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
restserver_1  | 2022.03.21 08:55:28:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
restserver_1  | 2022.03.21 08:55:28:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 1 migration (execution time 00:00.259s)
restserver_1  | 2022.03.21 08:55:29:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1
restserver_1  | 2022.03.21 08:55:29:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Schema `docspell` is up to date. No migration necessary.
restserver_1  | 2022.03.21 08:55:29:0002 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/migration/mariadb, classpath:db/migration/common)
restserver_1  | 2022.03.21 08:55:29:0003 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.run:52 - !!! Running main migrations
restserver_1  | 2022.03.21 08:55:29:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
restserver_1  | 2022.03.21 08:55:29:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
restserver_1  | 2022.03.21 08:55:29:0006 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
restserver_1  | 2022.03.21 08:55:29:0007 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
restserver_1  | 2022.03.21 08:55:30:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 61 migrations (execution time 00:00.372s)
solr_1        | 2022-03-21 07:55:48.321 INFO  (qtp1515403487-20) [   x:docspell] o.a.s.c.S.Request [docspell]  webapp=/solr path=/admin/ping params={} hits=0 status=0 QTime=0
solr_1        | 2022-03-21 07:55:48.324 INFO  (qtp1515403487-20) [   x:docspell] o.a.s.c.S.Request [docspell]  webapp=/solr path=/admin/ping params={} status=0 QTime=4
solr_1        | 2022-03-21 07:56:51.466 INFO  (qtp1515403487-18) [   x:docspell] o.a.s.c.S.Request [docspell]  webapp=/solr path=/admin/ping params={} hits=0 status=0 QTime=1
solr_1        | 2022-03-21 07:56:51.467 INFO  (qtp1515403487-18) [   x:docspell] o.a.s.c.S.Request [docspell]  webapp=/solr path=/admin/ping params={} status=0 QTime=1
solr_1        | 2022-03-21 07:57:53.726 INFO  (qtp1515403487-18) [   x:docspell] o.a.s.c.S.Request [docspell]  webapp=/solr path=/admin/ping params={} hits=0 status=0 QTime=0
solr_1        | 2022-03-21 07:57:53.727 INFO  (qtp1515403487-18) [   x:docspell] o.a.s.c.S.Request [docspell]  webapp=/solr path=/admin/ping params={} status=0 QTime=1
joex_1        | 2022.03.21 07:58:30:0000 [io-comp...] [ERROR] org.flywaydb.core.internal.command.DbMigrate - Migration of schema `docspell` to version "1.33.0 - reorganize file ids" failed! Please restore backups and roll back database and code!
restserver_1  | 2022.03.21 08:58:31:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1.33.0
joex_1        | org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V1.33.0__reorganize_file_ids.sql failed
joex_1        | -------------------------------------------------
joex_1        | SQL State  : 23000
joex_1        | Error Code : 1048
joex_1        | Message    : (conn=38) Column 'file_id' cannot be null
joex_1        | Location   : db/migration/mariadb/V1.33.0__reorganize_file_ids.sql (/opt/file:/opt/docspell-joex-0.34.0-SNAPSHOT/lib/com.github.eikek.docspell-store-0.34.0-SNAPSHOT.jar!/db/migration/mariadb/V1.33.0__reorganize_file_ids.sql)
joex_1        | Line       : 140
joex_1        | Statement  : -- update chunks
joex_1        | update filechunk
joex_1        |   set file_id = (select new_file
joex_1        |                  from file_migration_temp
joex_1        |                  where original_file = file_id and filechunk.file_id is not null)
joex_1        |
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:385)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:275)
joex_1        |         at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:274)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:247)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
joex_1        |         at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:58)
joex_1        |         at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:152)
joex_1        |         at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
joex_1        |         at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
joex_1        |         at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
joex_1        |         at docspell.store.migrate.FlywayMigrate.$anonfun$run$5(FlywayMigrate.scala:53)
joex_1        |         at blocking @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.exists(FilesPlatform.scala:204)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$run$4(FlywayMigrate.scala:53)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$run$2(FlywayMigrate.scala:52)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.createFlyway(FlywayMigrate.scala:36)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$run$1(FlywayMigrate.scala:51)
joex_1        |         at blocking @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.exists(FilesPlatform.scala:204)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$runFixups$4(FlywayMigrate.scala:65)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$runFixups$2(FlywayMigrate.scala:64)
joex_1        |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
joex_1        | Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V1.33.0__reorganize_file_ids.sql failed
joex_1        | -------------------------------------------------
joex_1        | SQL State  : 23000
joex_1        | Error Code : 1048
joex_1        | Message    : (conn=38) Column 'file_id' cannot be null
joex_1        | Location   : db/migration/mariadb/V1.33.0__reorganize_file_ids.sql (/opt/file:/opt/docspell-joex-0.34.0-SNAPSHOT/lib/com.github.eikek.docspell-store-0.34.0-SNAPSHOT.jar!/db/migration/mariadb/V1.33.0__reorganize_file_ids.sql)
joex_1        | Line       : 140
joex_1        | Statement  : -- update chunks
joex_1        | update filechunk
joex_1        |   set file_id = (select new_file
joex_1        |                  from file_migration_temp
joex_1        |                  where original_file = file_id and filechunk.file_id is not null)
joex_1        |
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:275)
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:222)
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:126)
joex_1        |         at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:69)
joex_1        |         at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:58)
joex_1        |         at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27)
joex_1        |         at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:57)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:377)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:275)
joex_1        |         at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:55)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:274)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:247)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
joex_1        |         at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:58)
joex_1        |         at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:152)
joex_1        |         at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
joex_1        |         at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
joex_1        |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
joex_1        |         at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
joex_1        |         at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
joex_1        |         at docspell.store.migrate.FlywayMigrate.$anonfun$run$5(FlywayMigrate.scala:53)
joex_1        |         at cats.effect.unsafe.WorkerThread.blockOn(WorkerThread.scala:591)
joex_1        |         at scala.concurrent.package$.blocking(package.scala:124)
joex_1        |         at cats.effect.IOFiber.runLoop(IOFiber.scala:967)
joex_1        |         at cats.effect.IOFiber.asyncContinueSuccessfulR(IOFiber.scala:1338)
joex_1        |         at cats.effect.IOFiber.run(IOFiber.scala:140)
joex_1        |         at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:523)
joex_1        | Caused by: java.sql.SQLIntegrityConstraintViolationException: (conn=38) Column 'file_id' cannot be null
joex_1        |         at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:278)
joex_1        |         at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:358)
joex_1        |         at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:133)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:807)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:746)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:665)
joex_1        |         at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:608)
joex_1        |         at org.mariadb.jdbc.Statement.executeInternal(Statement.java:906)
joex_1        |         at org.mariadb.jdbc.Statement.execute(Statement.java:1031)
joex_1        |         at org.mariadb.jdbc.Statement.execute(Statement.java:441)
joex_1        |         at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:201)
joex_1        |         at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:95)
joex_1        |         at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:210)
joex_1        |         ... 27 more
restserver_1  | 2022.03.21 08:58:33:0000 [io-comp...] [INFO ] org.http4s.blaze.client.PoolManager - Shutting down connection pool: curAllocated=0 idleQueues.size=0 waitQueue.size=0 maxWaitQueueLimit=256 closed=false
restserver_1  | org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Schema `docspell` contains a failed migration to version 1.33.0 !
restserver_1  |         at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:221)
restserver_1  |         at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141)
restserver_1  |         at org.flywaydb.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:58)
restserver_1  |         at org.flywaydb.database.mysql.MySQLConnection.lock(MySQLConnection.java:152)
restserver_1  |         at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
restserver_1  |         at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141)
restserver_1  |         at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:98)
restserver_1  |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:172)
restserver_1  |         at org.flywaydb.core.Flyway$1.execute(Flyway.java:124)
restserver_1  |         at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:205)
restserver_1  |         at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
restserver_1  |         at docspell.store.migrate.FlywayMigrate.$anonfun$run$5(FlywayMigrate.scala:53)
restserver_1  |         at blocking @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.exists(FilesPlatform.scala:204)
restserver_1  |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$run$4(FlywayMigrate.scala:53)
restserver_1  |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
restserver_1  |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$run$2(FlywayMigrate.scala:52)
restserver_1  |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
restserver_1  |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
restserver_1  |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
restserver_1  |         at flatMap @ docspell.store.migrate.FlywayMigrate.createFlyway(FlywayMigrate.scala:36)
restserver_1  |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$run$1(FlywayMigrate.scala:51)
restserver_1  |         at blocking @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.exists(FilesPlatform.scala:204)
restserver_1  |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$runFixups$4(FlywayMigrate.scala:65)
restserver_1  |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
restserver_1  |         at flatMap @ docspell.store.migrate.FlywayMigrate.$anonfun$runFixups$2(FlywayMigrate.scala:64)
restserver_1  |         at delay @ docspell.logging.impl.ScribeWrapper$Impl.log(ScribeWrapper.scala:28)
restserver_1  |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)
restserver_1  |         at map @ docspell.store.migrate.FlywayMigrate.$anonfun$createFlyway$1(FlywayMigrate.scala:37)

@eikek
Copy link
Owner

eikek commented Mar 21, 2022

Never worries about delays. Thank you a lot for trying this! So… I forgot to add the fixes for mariadb and h2 🤦🏼

I just pushed it to master, it would be great if you could give it another try when you have time. It is interesting to see what mariadb does now, because afaik it doesn't support transactions for ddl statements.

@mardom1
Copy link

mardom1 commented Mar 21, 2022

Fantastic news - it worked! 🎉

joex_1        | Mar 21, 2022 10:13:31 AM org.jline.utils.Log logr
joex_1        | WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
joex_1        | 2022.03.21 10:13:29:899 io-compute-2 INFO docspell.config.ConfigFactory.default:36
joex_1        |     Using config file: /opt/docspell.conf
joex_1        | 2022.03.21 10:13:35:0000 [io-comp...] [INFO ] docspell.joex.Main.run:37 -
joex_1        | ***>  ______                          _ _
joex_1        | ***>  |  _  \                        | | |
joex_1        | ***>  | | | |___   ___ ___ _ __   ___| | |
joex_1        | ***>  | | | / _ \ / __/ __| '_ \ / _ \ | |
joex_1        | ***>  | |/ / (_) | (__\__ \ |_) |  __/ | |
joex_1        | ***>  |___/ \___/ \___|___/ .__/ \___|_|_|
joex_1        | ***>                      | |
joex_1        | ***>                      |_| v0.34.0-SNAPSHOT (#f2a2d15e)
joex_1        | ***>  << JOEX >>
joex_1        | ***>  Id:       joex
joex_1        | ***>  Base-Url: http://joex:7878
joex_1        | ***>  Database: jdbc:mariadb://mysql:3306/docspell
joex_1        | ***>  Fts:      http://solr:8983/solr/docspell
joex_1        | ***>  Config:   /opt/docspell.conf
joex_1        | ***>  FileRepo: DefaultDatabase(true)
joex_1        | ***>
joex_1        | 2022.03.21 10:13:40:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/fixups/mariadb, classpath:db/fixups/common)
joex_1        | 2022.03.21 10:13:40:0001 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.runFixups:64 - !!! Running fixup migrations
joex_1        | 2022.03.21 10:13:40:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
joex_1        | 2022.03.21 10:13:40:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
joex_1        | 2022.03.21 10:13:40:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
joex_1        | 2022.03.21 10:13:40:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
joex_1        | 2022.03.21 10:13:41:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 1 migration (execution time 00:00.546s)
joex_1        | 2022.03.21 10:13:47:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table `docspell`.`flyway_fixup_history` with baseline ...
joex_1        | 2022.03.21 10:13:50:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbBaseline - Successfully baselined schema with version: 1
joex_1        | 2022.03.21 10:13:50:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1
joex_1        | 2022.03.21 10:13:50:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Migrating schema `docspell` to version "1.33.0 - fix reorganize files"
joex_1        | 2022.03.21 10:13:50:0003 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.valid_file_ids' (SQL State:  - Error Code: 1051)
joex_1        | 2022.03.21 10:13:53:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.obsolete_files' (SQL State:  - Error Code: 1051)
restserver_1  | Mar 21, 2022 11:14:12 AM org.jline.utils.Log logr
restserver_1  | WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
restserver_1  | 2022.03.21 11:14:10:361 io-compute-1 INFO docspell.config.ConfigFactory.default:36
restserver_1  |     Using config file: /opt/docspell.conf
restserver_1  | 2022.03.21 11:14:21:493 io-compute-1 WARN docspell.restserver.ConfigFile.generateSecretIfEmpty:57
restserver_1  |     No serverSecret specified. Generating a random one. It is recommended to add a server-secret in the config file.
restserver_1  | 2022.03.21 11:14:22:0000 [io-comp...] [INFO ] docspell.restserver.Main.run:34 -
restserver_1  | ***>  ______                          _ _
restserver_1  | ***>  |  _  \                        | | |
restserver_1  | ***>  | | | |___   ___ ___ _ __   ___| | |
restserver_1  | ***>  | | | / _ \ / __/ __| '_ \ / _ \ | |
restserver_1  | ***>  | |/ / (_) | (__\__ \ |_) |  __/ | |
restserver_1  | ***>  |___/ \___/ \___|___/ .__/ \___|_|_|
restserver_1  | ***>                      | |
restserver_1  | ***>                      |_| v0.34.0-SNAPSHOT (#f2a2d15e)
restserver_1  | ***>  << REST Server >>
restserver_1  | ***>  Id:       rest1
restserver_1  | ***>  Base-Url: http://192.168.178.25:7880
restserver_1  | ***>  Database: jdbc:mariadb://mysql:3306/docspell
restserver_1  | ***>  Fts:      http://solr:8983/solr/docspell
restserver_1  | ***>  Config:   /opt/docspell.conf
restserver_1  | ***>  FileRepo: DefaultDatabase(true)
restserver_1  | ***>
restserver_1  | 2022.03.21 11:14:35:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/fixups/mariadb, classpath:db/fixups/common)
restserver_1  | 2022.03.21 11:14:37:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.runFixups:64 - !!! Running fixup migrations
restserver_1  | 2022.03.21 11:14:37:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
restserver_1  | 2022.03.21 11:14:37:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
restserver_1  | 2022.03.21 11:14:37:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
restserver_1  | 2022.03.21 11:14:37:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
restserver_1  | 2022.03.21 11:14:37:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 2 migrations (execution time 00:00.198s)
restserver_1  | 2022.03.21 11:16:43:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1.33.0
restserver_1  | 2022.03.21 11:16:43:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Schema `docspell` is up to date. No migration necessary.
joex_1        | 2022.03.21 10:16:43:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Successfully applied 1 migration to schema `docspell`, now at version v1.33.0 (execution time 02:53.287s)
restserver_1  | 2022.03.21 11:16:43:0002 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/migration/mariadb, classpath:db/migration/common)
restserver_1  | 2022.03.21 11:16:43:0003 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.run:52 - !!! Running main migrations
joex_1        | 2022.03.21 10:16:44:0000 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.createFlyway:37 - Creating Flyway for: List(classpath:db/migration/mariadb, classpath:db/migration/common)
joex_1        | 2022.03.21 10:16:44:0001 [io-comp...] [INFO ] docspell.store.migrate.FlywayMigrate.run:52 - !!! Running main migrations
restserver_1  | 2022.03.21 11:16:45:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
restserver_1  | 2022.03.21 11:16:45:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
restserver_1  | 2022.03.21 11:16:45:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
restserver_1  | 2022.03.21 11:16:45:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
restserver_1  | 2022.03.21 11:16:45:0004 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 61 migrations (execution time 00:00.655s)
restserver_1  | 2022.03.21 11:16:45:0005 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Current version of schema `docspell`: 1.32.2
joex_1        | 2022.03.21 10:16:46:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 8.5.4 by Redgate
joex_1        | 2022.03.21 10:16:46:0001 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.4
joex_1        | 2022.03.21 10:16:46:0002 [io-comp...] [INFO ] org.flywaydb.core.internal.license.VersionPrinter -
joex_1        | 2022.03.21 10:16:46:0003 [io-comp...] [INFO ] org.flywaydb.core.internal.database.base.BaseDatabaseType - Database: jdbc:mariadb://mysql/docspell (MariaDB 10.5)
restserver_1  | 2022.03.21 11:16:45:0006 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Migrating schema `docspell` to version "1.33.0 - reorganize file ids"
restserver_1  | 2022.03.21 11:16:47:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.file_migration_temp' (SQL State:  - Error Code: 1051)
joex_1        | 2022.03.21 10:16:48:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbValidate - Successfully validated 61 migrations (execution time 00:01.856s)
restserver_1  | 2022.03.21 11:16:49:0000 [io-comp...] [WARN ] org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: Unknown table 'docspell.obsolete_files' (SQL State:  - Error Code: 1051)
restserver_1  | 2022.03.21 11:20:50:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Successfully applied 1 migration to schema `docspell`, now at version v1.33.0 (execution time 04:04.121s)
joex_1        | 2022.03.21 10:20:51:0000 [io-comp...] [INFO ] org.flywaydb.core.internal.command.DbMigrate - Successfully applied 1 migration to schema `docspell`, now at version v1.34.0 (execution time 04:02.799s)

@eikek
Copy link
Owner

eikek commented Mar 21, 2022

That's great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants