realm / realm-core

Core database component for the Realm Mobile Database SDKs
https://realm.io
Apache License 2.0
1.02k stars 158 forks source link

Error not propagated #7713

Closed nielsenko closed 1 week ago

nielsenko commented 4 months ago

When running the dart-sdk test-suite with latest realm (v14.7.0), the sync_migration_test.dart suite is failing.

I can one get one of two situations.

  1. Either the process waits until the test times out:
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Realm sync client ([realm-core-14.7.0]))
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Platform: macOS Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Binding '/var/folders/8p/4znrjyy500q5qtyknc6jmm9h0000gp/T/realm_test_0zS7uE/mongodb-realm/staticschema-local-rhuabaa/664c95f6691b2abc0b05e1b8/mlornoxeqa.realm' to '')
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: client_reset_config = false, Realm exists = true )
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Connecting to 'ws://localhost:9090/api/client/v2.0/app/staticschema-local-rhuabaa/realm-sync')
    (category: Realm.Sync.Client.Network, level: LogLevel.detail, message: Resolving 'localhost:9090')
    (category: Realm.Sync.Client.Network, level: LogLevel.detail, message: Connecting to endpoint '::1:9090' (1/2))
    (category: Realm.Sync.Client.Network, level: LogLevel.info, message: Connected to endpoint '::1:9090' (from '::1:61985'))
    (category: Realm.Sync.Client.Session, level: LogLevel.detail, message: Connection[1]: Negotiated protocol version: 12)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Connected to app services with request id: "664c95f6691b2abc0b05e1c1")
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Begin processing pending FLX bootstrap for query version 0. (changesets: 1, original total changeset size: 0))
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Integrated 1 changesets from pending bootstrap for query version 0, producing client version 8 in 1 ms. 0 changesets remaining in bootstrap)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Received: ERROR "Invalid schema change (UPLOAD): non-breaking schema change: adding schema for Realm table "Nullables", schema changes from clients are restricted when developer mode is disabled" (error_code=225, is_fatal=true, error_action=ApplicationBug))
    (category: Realm.SDK, level: LogLevel.error, message: Sync Error: Invalid schema change (UPLOAD): non-breaking schema change: adding schema for Realm table "Nullables", schema changes from clients are restricted when developer mode is disabled Logs: http://localhost:9090/groups/664c6cd2691b2abc0b048f88/apps/664c6cd6691b2abc0b0491e8/logs?co_id=664c95f6691b2abc0b05e1c1)
    (category: Realm.Sync.Client.Session, level: LogLevel.detail, message: Connection[1]: Linger time expired)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Disconnected)
    05:01 +0 -1: Can migrate property optionality [E]
    TimeoutException after 0:05:00.000000: Test timed out after 5 minutes.
    dart:isolate  _RawReceivePort._handleMessage
  2. or, an error is returned, but no error message is set, causing NRE.
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Realm sync client ([realm-core-14.7.0]))
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Platform: macOS Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Binding '/var/folders/8p/4znrjyy500q5qtyknc6jmm9h0000gp/T/realm_test_KFj7JA/mongodb-realm/staticschema-local-rhuabaa/664c9723691b2abc0b05ebb8/kersgmousl.realm' to '')
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: client_reset_config = false, Realm exists = true )
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Connecting to 'ws://localhost:9090/api/client/v2.0/app/staticschema-local-rhuabaa/realm-sync')
    (category: Realm.Sync.Client.Network, level: LogLevel.detail, message: Resolving 'localhost:9090')
    (category: Realm.Sync.Client.Network, level: LogLevel.detail, message: Connecting to endpoint '::1:9090' (1/2))
    (category: Realm.Sync.Client.Network, level: LogLevel.info, message: Connected to endpoint '::1:9090' (from '::1:62298'))
    (category: Realm.Sync.Client.Session, level: LogLevel.detail, message: Connection[1]: Negotiated protocol version: 12)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Connected to app services with request id: "664c9723691b2abc0b05ebc5")
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Begin processing pending FLX bootstrap for query version 0. (changesets: 1, original total changeset size: 0))
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Integrated 1 changesets from pending bootstrap for query version 0, producing client version 8 in 2 ms. 0 changesets remaining in bootstrap)
    (category: Realm.Sync.Client.Session, level: LogLevel.info, message: Connection[1]: Session[1]: Received: ERROR "Invalid schema change (UPLOAD): non-breaking schema change: adding schema for Realm table "Nullables", schema changes from clients are restricted when developer mode is disabled" (error_code=225, is_fatal=true, error_action=ApplicationBug))
    05:02 +2 -2: Realm can be migrated through consequtive versions (0->1->2) [E]
    Null check operator used on a null value

Expected results

Consistent behaviour, and a non-null error message returned from realm_sync_subscription_set_error_str

Actual Results

see above

Steps & Code to Reproduce

run dart test -j1 test/sync_migration_test.dart with trace level set to detail.

Core version

Core version: v14.7.0

sync-by-unito[bot] commented 4 months ago

➤ PM Bot commented:

Jira ticket: RCORE-2130

nielsenko commented 4 months ago

The issue was detected on v14.7.0, but I have reproduced with v14.6.2 as well (used in last production release of the Dart SDK).

I assume something has changed on BAAS (we should not be getting: "schema changes from clients are restricted when developer mode is disabled"), that in turn is surfacing this old bug.

nielsenko commented 4 months ago

error.realm.gz

sync-by-unito[bot] commented 3 months ago

➤ Jonathan Reams commented:

Is developer mode enabled in your test?

sync-by-unito[bot] commented 1 week ago

➤ jedelbo commented:

No activity for a long time