Importing data, getting "Field 'title' has unique values."

$ 8base import -f data.json
“error: Can’t insert data. Field ‘title’ has unique values.”

{
  "tables": [],
  "data": {
    "FooBars": [
      {
        "$id": "status-1",
        "title": "Not Defined",
        "value": 0
      }
    ]
  }
}

title and value are mandatory and no duplicates, there are no rows in the DB (new workspace), and only one row is being added. I exported and imported all table schemas successfully.

What does this error mean?

@mike_ekim1024 let us investigate it. I will let you know soon.

Hey @mike_ekim1024

It looks like you were running this import command against your old workspace, not the new one.
Can you please try again with the new workspace. If issue persists, can you please let me know what Table you are importing your data to and I will check again.

Thanks

I used 8base import -w ck0n…, but maybe I used the wrong data for workspace, and instead of an error it just used the default workspace? No, I tried an invalid id and it complained.

I thought the workspace was the last part of the endpoint?

https://api.8base.com/ck0n

By the way, how do you change workspace from the CLI without loggin out and back in?

@mike_ekim1024 “ck0n …” is your old workspace, "ck2c … " is the new one.
Latest version of 8base-cli keeps track of your workspace on per project (folder) basis. So if you have 2 workspaces you should create 2 separate folders for them now and select workspace in each of them.

  8base configure            Allows you to select a default workspace and retrieve the API endpoint URL.

$ 8base import -w ck2c… -f data.json (my mistake I wrote the wrong id in the previous message)
error: Can’t insert data. Field ‘title’ has unique values.

{
  "data": {
    "tasksStatusesList": {
      "items": []
    }
  }
}

@mike_ekim1024 ok, found the bug in cli with import with “-w” option. Just released a fix for it.
You can update cli with “npm install -g 8base-cli” command and try to run your import again. It should work fine now.

Thanks for reporting this issue!

Why is there 8base and 8base-cli?

8base v0.79
8base-cli v0.88


8base used to be the cli, however it wasn’t clear then that other packages were requires for the sdk.

We decided to change the approach last month so that there was some more explicit naming conventions. Ones that also separated out framework specific code from the base SDK.

  • 8base-cli
  • 8base-sdk
  • 8base-react-sdk
  • etc…

At this point, the 8base v0.79 is no longer being developed, and we should depreciate it.

@mike_ekim1024 we deprecated this CLI package https://www.npmjs.com/package/8base
use https://www.npmjs.com/package/8base-cli instead.