Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"InvalidRequestException: Bucket name should not contain uppercase characters" when used on aws lambda #90

Open
cm-rwakatsuki opened this issue Oct 25, 2022 · 1 comment

Comments

@cm-rwakatsuki
Copy link

I created aws lambda handler using athena-express.

import { AthenaExpress } from 'athena-express';
import * as AWS from 'aws-sdk';

const ATHENA_WORK_GROUP_NAME = process.env.ATHENA_WORK_GROUP_NAME || '';
const GLUE_DATABASE_NAME = process.env.GLUE_DATABASE_NAME || '';
const SOURCE_GLUE_TABLE = process.env.SOURCE_GLUE_TABLE || '';

AWS.config.update({ region: 'ap-northeast-1' });

const athenaExpress = new AthenaExpress({
  aws: AWS,
  workgroup: ATHENA_WORK_GROUP_NAME,
});

export const handler = async (): Promise<void> => {
  const sqlQuery = `SELECT * FROM ${GLUE_DATABASE_NAME}.${SOURCE_GLUE_TABLE}`;

  const results = await athenaExpress.query(sqlQuery);

  console.log(results);
};

But, execution of this lambda ends with below error.

{
  "errorType": "Error",
  "errorMessage": "InvalidRequestException: Bucket name should not contain uppercase characters",
  "trace": [
    "Error: InvalidRequestException: Bucket name should not contain uppercase characters",
    "    at AthenaExpress.query (/var/task/index.js:8023:17)",
    "    at processTicksAndRejections (internal/process/task_queues.js:95:5)",
    "    at async Runtime.handler (/var/task/index.js:8058:19)"
  ]
}

version info:

$  npm ls aws-sdk athena-express
aws-cdk-app@0.1.0 /Users/wakatsuki.ryuta/projects/cm-rwakatsuki/aws-cdk-app
├── athena-express@7.1.5
└── aws-sdk@2.1238.0
@ghdna
Copy link
Owner

ghdna commented Nov 15, 2022

Were you able to resolve this?
This reads like an AWS error and not much to do with this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants