0

I am trying to load a csv into a database in DataStax Astra using the DSBulk tool.

Here is the command I ran minus the sensitive details:

dsbulk load -url D:\\App\\data.csv -k data -t data -b D:\\App\\secure-connect-myapp -u username -p password

Here is the error I get back:

Operation LOAD_20221206-004421-512000 failed: Invalid bundle: missing file config.json.

Here is the full log:

2022-12-06 00:44:21 INFO  Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2022-12-06 00:44:21 INFO  A cloud secure connect bundle was provided: ignoring all explicit contact points.
2022-12-06 00:44:21 INFO  A cloud secure connect bundle was provided and selected operation performs writes: changing default consistency level to LOCAL_QUORUM.
2022-12-06 00:44:21 INFO  Operation directory: C:\Program Files\dsbulk-1.10.0\bin\logs\LOAD_20221206-004421-512000
2022-12-06 00:44:21 ERROR Operation LOAD_20221206-004421-512000 failed: Invalid bundle: missing file config.json.
java.lang.IllegalStateException: Invalid bundle: missing file config.json
    at com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory.createCloudConfig(CloudConfigFactory.java:114)
    at com.datastax.oss.driver.api.core.session.SessionBuilder.buildDefaultSessionAsync(SessionBuilder.java:876)
    at com.datastax.oss.driver.api.core.session.SessionBuilder.buildAsync(SessionBuilder.java:817)
    at com.datastax.oss.driver.api.core.session.SessionBuilder.build(SessionBuilder.java:835)
    at com.datastax.oss.dsbulk.workflow.commons.settings.DriverSettings.newSession(DriverSettings.java:560)
    at com.datastax.oss.dsbulk.workflow.load.LoadWorkflow.init(LoadWorkflow.java:145)
    at com.datastax.oss.dsbulk.runner.WorkflowThread.run(WorkflowThread.java:52)

The error says that config.json is missing, but it isn't. So I'm stuck. Unless it's looking somewhere other than in the bundle I specified, but the bundle definitely has the config.json file.

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23

2 Answers2

0

In order for you to leverage DataStax Bulk Loader (aka DSBulk, in short), you would need to pass in the secure connect bundle (SCB) correctly. What I mean when I say is that you need either the fully qualified path or the relative path to the SCB file.

The correct command in your case would look like:

./dsbulk load -url 'D:\\App\\data.csv' -k data -t data -b 'D:\\App\\secure-connect-myapp.zip' -u username -p password

Note that -b option takes in the full SCB filename along with .zip file extension.

Other Resources:

blackgreen
  • 34,072
  • 23
  • 111
  • 129
Madhavan
  • 758
  • 4
  • 8
  • I had unzipped the bundle and pointed to that, that was the problem, I did not realize it needed to remain zipped. Good reminder not to do more than instructed. Thank you very much for your help. – Steve Monroe Dec 08 '22 at 01:59
  • You're very welcome! And, yes the bundle has to be in a zipped format. – Madhavan Dec 09 '22 at 11:46
0

This error:

...
java.lang.IllegalStateException: Invalid bundle: missing file config.json
    at com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory.createCloudConfig(CloudConfigFactory.java:114)
    ...

indicates that the Java driver bundled with DSBulk is unable to connect to your Astra DB because it couldn't get the configuration details from the secure connect bundle.

Please make sure that the valid secure bundle ZIP is accessible to DSBulk. You need to provide the path to the ZIP file, not just the directory. For example:

$ dsbulk ... -b /path/to/secure-connect-db.zip ...

Please check the path in your command then try again. Cheers!


Please support the Apache Cassandra community by hovering over the cassandra tag above and click on Watch tag. Thanks!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • That was exactly it, I had unzipped it and pointed to that. Thank you very much. A note for anyone that incorrectly did the same as me, to resolve this, I at first tried zipping it back up but that did not work. I had to re-download the zipped bundle. – Steve Monroe Dec 08 '22 at 02:03
  • Glad you got it working. Cheers! – Erick Ramirez Dec 08 '22 at 02:33