Closed joshis2020 closed 4 years ago
Can you try with a different bucket name? And are you sure your AWS credentials are accurate?
Thanks for your response, yes I can confirm that my credentials are correct. They have admin access and also I could perform various CLI commands successfully.
I also tried putting a different s3 bucket, but still the same issue.
That seems correct. Try commenting out the validation logic and then running it. Comment out this line (line no. 11)
helpers.validateConstructor(init);
in athena-express/lib/athenaExpress.js
I tried commenting the line helpers.validateConstructor(init); and performed npm start, but it results into another issue
Uncaught TypeError: init.aws.Athena is not a constructor
at new AthenaExpress (athenaExpress.js:13)
at Module../src/App.js (App.js:57)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Module../src/index.js (index.css?f3f6:45)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object.1 (serviceWorker.js:141)
at __webpack_require__ (bootstrap:784)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
That means the aws
object being passed in the athenaExpressConfig
isn't correct.
I see, but I am not sure where I may be going wrong in setting the credentials. Initially, I tried with cognito temporary credentials. Just to make sure, correct things are set, I hard coded them and used my user's credentials having both programmatic and console access with admin permissions. As far as the path is considered, isn't it optional? But I went ahead and tried different s3 buckets.
Yeah the path is optional. Athena-express can create a bucket for you when you don't provide a path. Are you able to test this on a standalone node.js app, just lifting from the example?
Hi,
The same code works when I test it using a standalone node.js app. Is there any compatibility issue when we use athena-express with react? I would really like to use this for my frontend dashboard :(
There shouldn't be any compatibility issue (unless react is interfering) . But in any case, you shouldn't be calling athena-express directly from your React app because React is a client side framework and will expose your AWS object (secret/access keys) to the internet. Athena-Express is a middlewear and should be hosted on a standalone Node.js or a Lambda function, which you can then connect with React. That way your AWS object isn't exposed outside.
Gonna close this now since its not an athena-express issue (as that works in a standalone module)
I have a react app (created using create-react-app) and I have installed both the aws-sdk and athena express under the same. I passed the correct AWS credentials in the awsCredentials object and also specified a s3 path for storing the query results, but I am still getting the above error.
const athenaExpress = new AthenaExpress(athenaExpressConfig); // this is where it fails
Below is the stack trace, I would appreciate any assistance over the same: