objectboxflutter-objectboxobjectbox-android

Objectbox Sync Server Configuration Troubleshooting


Follow guide from https://sync.objectbox.io/objectbox-sync-server

I already has my downloaded Objectbox sync server files

  1. Download My Objectbox sync-server file (i got it from Objectbox Team) that and extract it
  2. Copy my objectbox-model.json (generated file from my flutter app) to the extracted folder

try with

     ./sync-server --model=objectbox-model.json --unsecure-no-authentication

It gave me

     001-16:08:29.6169 [INFO ] [SySvAp] Starting ObjectBox Sync Server version 2 
     (protocol version: 3, core: 2.9.2-2021-07-19 (SyncServer, admin, tree, dlog))
     error parsing options: Option ‘unsecure-no-authentication’ does not exist
  1. Create configuration file (sync-server-config.js) Contain:

     {
      "dbDirectory": "objectbox",
      "dbMaxSize": "100G",
      "modelFile": "objectbox-model.json",
      "bind": "ws://0.0.0.0:9999",
      "browserBind": "http://127.0.0.1:9980",
      "browserThreads": 4,
      "certificatePath": "",
      "auth": {
      "sharedSecret": "<secret>",
      }
     }
    
  2. And Open Terminal on from that folder Run ./sync-server

  3. It return me Error

      001-16:35:51.9701 [INFO ] [SySvAp] Starting ObjectBox Sync Server version 2 
      (protocol version: 3, core: 2.9.2-2021-07-19 (SyncServer, admin, tree, dlog))
      001-16:35:51.9702 [INFO ] [SySvAp] Loading configuration file sync-server- 
      config.js
      Error loading configuration file sync-server-config.js - Invalid JSON at 283 - 
      Missing a name for object member..
    

I did try with

     certificatePath": "", 

removed, also give the same error

I am new to Objectbox and I want to try with the Sync Part,

your help would be appreciated. Thanks


Solution

  • The option to use no authentication for development is called --unsecured-no-authentication (note the d in unsecured). (This was actually a typo in our docs.)

    Note that you can use --help to show available options (https://sync.objectbox.io/objectbox-sync-server#configuration).