question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Invalid S3 bucket name (value: SOURCE_BUCKET) during Dev deploy

See original GitHub issue

Describe the bug getting an error during initial deployment. I am trying to do the Dev approach for the install. Seems it is trying to create a bucket with no name or bad name. Ive installed all re reqs. This is in a Cloud9 IDE. It pass all previous tests up to this point. I have tried to dig into /cdk-textract-client-stack.ts but I cannot see where SOURCE_BUCKET actually gets its value. Your expert insight would be greatly appreciated

error:

Running tests for datastore Test region is us-east-1 /home/ec2-user/.local/lib/python3.7/site-packages/responses/init.py:484: DeprecationWarning: stream argument is deprecated. Use stream parameter in request directly DeprecationWarning, .Error : An error occurred (ConditionalCheckFailedException) when calling the UpdateItem operation: A condition specified in the operation could not be evaluated. A condition specified in the operation could not be evaluated. …response: {‘Items’: [{‘documentId’: ‘b1a54fda-1809-49d7-8f19-0d1688eb65b9’, ‘objectName’: ‘public/samples/Misc/expense.png’, ‘bucketName’: ‘dusstack-sample-s3-bucket’, ‘documentStatus’: ‘IN_PROGRESS’}, {‘documentId’: ‘b1a99fda-1809-49d7-8f19-0d1688eb65b9’, ‘objectName’: ‘public/samples/Misc/expense.png’, ‘bucketName’: ‘dusstack-sample-s3-bucket’, ‘documentStatus’: ‘IN_PROGRESS’}], ‘Count’: 2, ‘ScannedCount’: 2, ‘ConsumedCapacity’: {‘TableName’: ‘DocumentsTestTable’, ‘CapacityUnits’: 1}, ‘ResponseMetadata’: {‘RequestId’: ‘C5M72NYUQUFHHS0ILX3HFC7W4LFLPWXEZGYQZY138HS6KE7ZH8CT’, ‘HTTPStatusCode’: 200, ‘HTTPHeaders’: {‘server’: ‘amazon.com’, ‘x-amzn-requestid’: ‘C5M72NYUQUFHHS0ILX3HFC7W4LFLPWXEZGYQZY138HS6KE7ZH8CT’}, ‘RetryAttempts’: 0}} …A condition specified in the operation could not be evaluated. .

Ran 10 tests in 1.069s

OK sys:1: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=(‘0.0.0.0’, 0)> warning …/…/…/package.json: No license field $ yarn compile-ts-backend-stack && yarn compile-ts-client-stack warning …/…/…/package.json: No license field $ tsc lib/cdk-textract-stack.ts --target es2018 --module commonjs --allowjs true warning …/…/…/package.json: No license field $ tsc lib/cdk-textract-client-stack.ts --target es2018 --module commonjs --allowjs true warning …/…/…/package.json: No license field $ AWS_REGION=$npm_package_stack_region USER_EMAIL=$npm_package_email cdk bootstrap --toolkit-stack-name DocumentUnderstandingCDKToolkit /home/ec2-user/environment/document-understanding-solution/source/node_modules/@aws-cdk/aws-s3/lib/bucket.js:750 throw new Error(Invalid S3 bucket name (value: ${bucketName})${os_1.EOL}${errors.join(os_1.EOL)}); ^

Error: Invalid S3 bucket name (value: SOURCE_BUCKET) Bucket name must only contain lowercase characters and the symbols, period (.) and dash (-) (offset: 0) Bucket name must start and end with a lowercase character or number (offset: 0) Bucket name must start and end with a lowercase character or number (offset: 12) at Function.validateBucketName (/home/ec2-user/environment/document-understanding-solution/source/node_modules/@aws-cdk/aws-s3/lib/bucket.js:750:19) at Function.fromBucketAttributes (/home/ec2-user/environment/document-understanding-solution/source/node_modules/@aws-cdk/aws-s3/lib/bucket.js:673:16) at Function.fromBucketName (/home/ec2-user/environment/document-understanding-solution/source/node_modules/@aws-cdk/aws-s3/lib/bucket.js:654:23) at new CdkTextractStack (/home/ec2-user/environment/document-understanding-solution/source/lib/cdk-textract-stack.js:509:62) at Object.<anonymous> (/home/ec2-user/environment/document-understanding-solution/source/bin/deploy-backend.js:32:1) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) Subprocess exited with error 1 error Command failed with exit code 1.

To Reproduce run yarn deploy

Expected behavior A clear and concise description of what you expected to happen.

Please complete the following information about the solution:

  • Version: [e.g. v1.0.3] v1.0.3
  • Region: [e.g. us-east-1] us-east-1
  • Was the solution modified from the version published on this repository? negative, just trying to test out initial template
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the sevices this solution uses? no but this basically a vanilla aws org/account with nothing in it, lmk if I need to check something
  • Were there any errors in the CloudWatch Logs? no

Screenshots If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickthebrucecommented, Feb 22, 2022

guys I simply commented out any reference to cicdBotoLoc and cicdPDFLoc because wasnt using the CICD deployment at all. There is also a conditional ternary you will need to comment out or change on line 772 if you go this route.

AFA the client stack I would make sure you have all pre reqs, it worked for me after i did. You can get the true pre reqs frrom lines 167-210 in /document-understanding-solution/deployment/document-understanding-solution.template

1reaction
mwl387commented, Feb 22, 2022

In addition to the above change, in line 25 of package.json, I modified the bootstrap to include the cicd flag and was able to get the yarn DUSStack to deploy. Client stack isn’t deploying though.

"bootstrap": "ISCICD=$npm_package_cicd AWS_REGION=$npm_package_stack_region USER_EMAIL=$npm_package_email cdk bootstrap --toolkit-stack-name DocumentUnderstandingCDKToolkit",

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid bucket name error when AWS Lambda tries to copy ...
The source bucket does not have any folder structure. The destination bucket has a folder structure and the files need to be copied...
Read more >
Troubleshoot "Invalid S3 location" error when saving query ...
My Amazon Athena query fails to save results on the specified Amazon Simple Storage Service (Amazon S3) bucket. Short description. Amazon Athena ...
Read more >
terraform-aws-modules/s3-bucket/aws
This module solves this issue by supporting jsonencode() -string in addition to the expected type ( list or map ). In terragrunt.hcl you...
Read more >
Buckets - Flux CD
yaml , and changing the Bucket and Secret values to target a Minio instance you have control over. Note: For more advanced examples...
Read more >
Invalid bucket name s3 testdm Bucket name must match the ...
I tried to view the content of my bucket but I am getting this error: C:\Users\jino>aws s3 ls s3:\\testdm ... the regex "^[a-zA-Z0-9....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found