AppFlowy-IO / AppFlowy-Cloud

AppFlowy is an open-source alternative to Notion. You are in charge of your data and customizations. Built with Flutter and Rust.
GNU Affero General Public License v3.0
958 stars 198 forks source link

[Bug] public.af_collab_embeddings doesn't exists #801

Open henri9813 opened 2 weeks ago

henri9813 commented 2 weeks ago

Describe the bug

Hello, I just upgraded my appflowy, I precise my AI is disabled because I can't pay for OpenAI.

Sorry if I don't follow the issue guidelines, but It's doesn't fit to my issue.

Log of history container

appflowy_history-1  | {"timestamp":"2024-09-08T09:46:52.728299Z","level":"INFO","fields":{"message":"config loaded: Config { app_env: Production, redis_url: \"redis://redis:6379\", db_settings: DatabaseSetting { pg_conn_opts: PgConnectOptions { host: \"postgres\", port: 5432, socket: None, username: \"postgres\", password: Some(\"password\"), database: Some(\"postgres\"), ssl_mode: Prefer, ssl_root_cert: None, ssl_client_cert: None, ssl_client_key: None, statement_cache_capacity: 100, application_name: None, log_settings: LogSettings { statements_level: Debug, slow_statements_level: Warn, slow_statements_duration: 1s }, extra_float_digits: Some(\"2\"), options: None }, require_ssl: false, max_connections: 20, database_name: \"postgres\" }, stream_settings: StreamSetting { control_key: \"af_collab_control\" } }"},"target":"appflowy_history::application"}
appflowy_history-1  | {"timestamp":"2024-09-08T09:46:52.728338Z","level":"INFO","fields":{"message":"Starting server at: Ok(0.0.0.0:50051)"},"target":"appflowy_history::application"}
appflowy_history-1  | {"timestamp":"2024-09-08T09:46:52.728348Z","level":"INFO","fields":{"message":"Preparing to run database migrations..."},"target":"appflowy_history::application"}
appflowy_history-1  | {"timestamp":"2024-09-08T09:46:52.728351Z","level":"INFO","fields":{"message":"Connecting to postgres database with setting: DatabaseSetting { pg_conn_opts: PgConnectOptions { host: \"postgres\", port: 5432, socket: None, username: \"postgres\", password: Some(\"password\"), database: Some(\"postgres\"), ssl_mode: Prefer, ssl_root_cert: None, ssl_client_cert: None, ssl_client_key: None, statement_cache_capacity: 100, application_name: None, log_settings: LogSettings { statements_level: Debug, slow_statements_level: Warn, slow_statements_duration: 1s }, extra_float_digits: Some(\"2\"), options: None }, require_ssl: false, max_connections: 20, database_name: \"postgres\" }"},"target":"appflowy_history::application"}
appflowy_history-1  | thread 'main' panicked at /app/services/appflowy-history/src/application.rs:35:41:
appflowy_history-1  | called `Result::unwrap()` on an `Err` value: Failed to run migrations: while executing migration 20240904000000: error returned from database: relation "public.af_collab_embeddings" does not exist
appflowy_history-1  | 
appflowy_history-1  | Stack backtrace:
appflowy_history-1  |    0: anyhow::error::<impl anyhow::Error>::msg
appflowy_history-1  |    1: appflowy_history::application::create_app::{{closure}}
appflowy_history-1  |    2: appflowy_history::main::{{closure}}
appflowy_history-1  |    3: appflowy_history::main
appflowy_history-1  |    4: std::sys_common::backtrace::__rust_begin_short_backtrace
appflowy_history-1  |    5: std::rt::lang_start::{{closure}}
appflowy_history-1  |    6: main
appflowy_history-1  |    7: <unknown>
appflowy_history-1  |    8: __libc_start_main
appflowy_history-1  |    9: _start
appflowy_history-1  | stack backtrace:
appflowy_history-1  |    0: rust_begin_unwind
appflowy_history-1  |    1: core::panicking::panic_fmt
appflowy_history-1  |    2: core::result::unwrap_failed
appflowy_history-1  |    3: appflowy_history::main::{{closure}}
appflowy_history-1  |    4: appflowy_history::main
appflowy_history-1  | note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Log of Postgres container

postgres-1  | 2024-09-08 09:49:55.006 UTC [70] ERROR:  relation "public.af_collab_embeddings" does not exist
postgres-1  | 2024-09-08 09:49:55.006 UTC [70] STATEMENT:  CREATE INDEX af_collab_embeddings_oid_idx ON public.af_collab_embeddings (oid);

Appflowy cloud log:

appflowy_cloud-1  | {"timestamp":"2024-09-08T09:48:54.523618Z","level":"INFO","fields":{"message":"Preparing to run database migrations..."},"target":"appflowy_cloud::application","filename":"src/application.rs","line_number":201}
appflowy_cloud-1  | {"timestamp":"2024-09-08T09:48:54.523637Z","level":"INFO","fields":{"message":"Connecting to postgres database with setting: DatabaseSetting { pg_conn_opts: PgConnectOptions { host: \"postgres\", port: 5432, socket: None, username: \"postgres\", password: Some(\"password\"), database: Some(\"postgres\"), ssl_mode: Prefer, ssl_root_cert: None, ssl_client_cert: None, ssl_client_key: None, statement_cache_capacity: 100, application_name: None, log_settings: LogSettings { statements_level: Debug, slow_statements_level: Warn, slow_statements_duration: 1s }, extra_float_digits: Some(\"2\"), options: None }, require_ssl: false, max_connections: 40 }"},"target":"appflowy_cloud::application","filename":"src/application.rs","line_number":486}
appflowy_cloud-1  | Error: Failed to initialize application state: Failed to run migrations: while executing migration 20240904000000: error returned from database: relation "public.af_collab_embeddings" does not exist
appflowy_cloud-1  | 
appflowy_cloud-1  | Stack backtrace:
appflowy_cloud-1  |    0: anyhow::error::<impl anyhow::Error>::msg
appflowy_cloud-1  |    1: tokio::task::local::LocalSet::run_until::{{closure}}
appflowy_cloud-1  |    2: appflowy_cloud::main
appflowy_cloud-1  |    3: std::sys_common::backtrace::__rust_begin_short_backtrace
appflowy_cloud-1  |    4: main
appflowy_cloud-1  |    5: <unknown>
appflowy_cloud-1  |    6: __libc_start_main
appflowy_cloud-1  |    7: _start

Additional context

speed2exe commented 2 weeks ago

@henri9813 Thank you for reporting the issue. For a quick fix, you can remove the file migrations/20240904000000_af_collab_embeddings_indices.sql We will provide the fix in future releases.

henri9813 commented 2 weeks ago

Thanks, I rollback my vm as a workaround while waiting for your fix :)