bettina.swynnerton avatar image
bettina.swynnerton asked stephaniesalvador1_162030 commented

How to upload the secure connection bundle via UI when using Python backend in Gitpod?

If you are having trouble uploading the Astra secure connection bundle through the Getting Started with Astra UI, using the Python backend API, please verify you followed the steps outlined in the answer below.

If you still face issues, comment with a screenshot showing the POST error in the browser developer tools.

If you are using the Java backend API, check this other post here:

1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

stephaniesalvador1_162030 avatar image stephaniesalvador1_162030 commented ·

For step 4 - do I add /api to the end like the workshop instructions? ie: echo 'BASE_ADDRESS=' > .env

For step 5 - after submiting python - do I leave that terminal alone (don't ctrl C)? How do you open a new terminal in gitpod?

0 Likes 0 ·

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered bettina.swynnerton edited


thanks for attending week 4 of the Cassandra Cloud-Native Workshop Series.

If you followed along and have problems uploading the secure connection bundle through the UI while running on Gitpod and using the Python API, check that you followed the following steps.

There is another post for Java API, and if you are running locally, it is unlikely that you run into this issue.

Step 1:

Start Gitpod and then start the Python backend:

Important: Do not start a virtual environment on gitpod. (this is only needed when running on your local machine)

Navigate to the getting-started-with-astra-python folder, install your dependencies and run the app:

pip install Flask flask-cors cassandra-driver

You should see this output:

Step 2:

Make port 5000 public, and open a browser:

You will see a page like this:

This is expected, as we are not serving a page, but the API is up:

Step 3:

Take a copy of the URL in the browser. You will need the URL to give the base address of the API to the UI.

It will look similar to this (this is uniquely generated for your gitpod workspace)

In contrast to Java, there is no Swagger, sorry.

Step 4:

Create a .env file for UI, in the root directory of getting-started-with-astra-ui

It needs to contain this text. Important: Since we made some changes the backend, please no longer use a localhost address for the BASE_ADDRESS.


Step 5:

Open new terminal and navigate to the getting-started-with-astra-ui folder

run npm install

then start the UI with npm run start

Make port 3000 public and start a browser.

Step 6:

In your browser, populate the credentials and click Test

If the test is successful, you will see a green confirmation in the lower left hand corner of the browser screen.

That's it! You are good, you can now proceed to saving this connection and launch your spaceships.

Step 7, in case you run into connection issues like this:

Open your browser's development tool, and take a note of the POST and GET errors when testing the connection (you can ignore other errors about sock.js, sorry about those)

If you are seeing CORS policy issues in your browser, please follow this advice here:

PS. This post has been updated after we made more changes to the backend APIs, and a BASE_ADDRESS containing a localhost address is no longer a valid address.

1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

David Jones-Gilardi avatar image David Jones-Gilardi ♦ commented ·

Thank you for the nice writeup @bettina.swynnerton

0 Likes 0 ·