Build Cloud-Native apps with Apache Cassandra

GOT QUESTIONS from the Workshop? You're in the right place! Post a question here and we'll get you answers.

Click here for Week 7 Materials and Homework.

Registrations still open!


question

diptesh1410_193094 avatar image
diptesh1410_193094 asked ·

Why am I not able to upload my secure bundle connect via Getting Started with Astra UI?

Why am I not able to upload my secure bundle connect?

workshop
10 |1000 characters needed characters left characters exceeded

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

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi,

I have tested a workaround to the problem with the file upload into the form data on Windows 10.

I believe that the problem is that the file type of the zip file is not correctly recognised or advertised by Windows 10 file explorer. This in turn causes the drag and drop box to reject the file.

The following workaround worked for me on my Windows 10 desktop, tested with Chrome.

In gitpod, find the file CredentialsDialog.jsx:

/workspace/cassandra-workshop-series/week4-AppDev-api/getting-started-with-astra-ui/src/components/CredentialsDialog.jsx

Comment out line 98 (here in bold):

                    {(!files || !files.length) &&
                        <DialogContentText>
                            Choose your Secure Connect Bundle:*
                            <DropzoneArea
                                //acceptedFiles={["application/zip"]}
                                filesLimit={1}
                                dropzoneText="Drag and Drop your Secure Connect Bundle here or click to choose"
                                onChange={updateFiles}
                                showFileNames={true}
                                showPreviews={true}
                                showPreviewsInDropzone={false}
                                showAlerts={false}
                            />
                        </DialogContentText>
                    }

In this line, we specify the allowed file types. By commenting it out, we allow any type.

Save the file, and restart the UI.

Now, when you want to populate the connection dialog:

Do not click on the drag and drop box to choose the file.

Instead, open a file explorer and drop the secure bundle from the explorer into the box.

In my tests, this allowed me to populate the dialog.

After that I could successfully test the connection and save for database access.

Please let me know if this works for you.

Thanks for your patience!

2 comments Share
10 |1000 characters needed characters left characters exceeded

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

This worked for me on windows 10 can now upload the bundle...now to debug the auth error :(

1 Like 1 · ·

HI @craigwoollett_175463,

I am delighted to hear that this workaround worked for you, too.

What is the auth error?

0 Likes 0 · ·
dorim_193021 avatar image
dorim_193021 answered ·

@bettina.swynnerton

I'm able to load the file as you described. But when I'm trying to Test Connection:

In the backend server screen I'm getting:

127.0.0.1 - - [26/Jul/2020 07:37:33] "GET / HTTP/1.1" 404 -

127.0.0.1 - - [26/Jul/2020 07:37:33] "GET /favicon.ico HTTP/1.1" 404 -


In the UI screen I'm getting a long message:

{"message":"Network Error","name":"Error","stack":"Error: Network Error\n at createError (webpack-internal:///./node_modules/axios/lib/core/createError.js:16:15)\n at XMLHttpRequest.handleError (webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:81:14)","config":{"url":"http://localhost:5000/api/credentials/test?username=KVUser&password=KVPassword&keyspace=killrvideo","method":"post","data":{},"headers":{"Accept":"application/json, text/plain, */*"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1}}
Share
10 |1000 characters needed characters left characters exceeded

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

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @diptesh1410_193094,

if you are working on gitpod, would you look through the steps according to your backend (Java or Python) and comment in the relevant post with the exact error you are seeing in the developer tools?

For Java: https://community.datastax.com/questions/6805/

Note that we updated the Java code since the workshop, so start a new gitpod workspace and try again.

For Python: https://community.datastax.com/questions/6796/

Thanks!


3 comments Share
10 |1000 characters needed characters left characters exceeded

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

@bettina.swynnerton

Hi,

I'm using the python version of the exercise.

I followed all steps in the link the following link:

For Python: https://community.datastax.com/questions/6796/


But when I choose the secure bundle file it doesn't upload. Nothing happened.

Could you tell what is wrong?


Thanks!

0 Likes 0 · ·

Hi @dorim_193021,

could you check in the developer console what POST error you are seeing when you test the connection in the UI?

Are you on doing this on gitpod?

Thanks for cooperation, we want to get this right for you.

0 Likes 0 · ·

Perhaps I am misunderstanding what is meant by upload.

There are two uploads here: One is the upload to the formdata in the browser, so you get to this stage:


The other upload is the POST request to the API backend, which sends through these credentials. That post request is triggered when we test the connection or save the connection.

Which one is failing in your case?

1 Like 1 · ·