Open skilbjo opened 1 year ago
this just started happening as of 29 June; without any code changes.
I go back to a working build, click "re-run jobs" and it fails w the above error. So I think it's something to do with github actions.
Anyways opening a thread here to see if anyone has come up w a workaround
My team just suffered the same issue. One of my teammates realized that when initializing dynamodb-local, we were downloading the latest version from AWS repo. We now have pinned to the latest working version, dynamodb_local_2023-06-09.tar.gz, and the issue is solved.
@0aprl1
could you expand? how did you get it to work? can you share the code sample of your workaround?
@skilbjo I just setup this config on my config file
installerConfig: {
downloadUrl: 'https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/dynamodb_local_2023-06-09.tar.gz'
}
great! thanks for that. and just to clarify, here's where it goes:
jest-dynamodb-config.js
module.exports = {
// https://github.com/shelfio/jest-dynamodb/issues/212
installerConfig: {
downloadUrl:
'https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/dynamodb_local_2023-06-09.tar.gz',
},
i will leave the issue open in case the maintainer wants to address, but ^^^ is a valid workaround atm
Same issue here. What worked for us was "installing" an older version of dynamodb-local before running the unit test.
module.exports = {
installerConfig: {
installPath: '.dynamodb',
},
}
#!/bin/sh
curl -O https://d1ni2b6xgvw0s0.cloudfront.net/dynamodb_local_2023-06-09.tar.gz <-- this is where the link goes from AWS in my part of the world. Chose the same file from @skilbjo above
mkdir -p .dynamodb && mv dynamodb_local_2023-06-09.tar.gz .dynamodb/
tar -xvf .dynamodb/dynamodb_local_2023-06-09.tar.gz -C .dynamodb/
npm run test
You can add checks not to run the above commands everytime you run the test.
For anyone who is facing this issue, this is the fix which resolved the issues for me. Add below logic to your jest-dynamodb-config.js
:
jest-dynamodb-config.js
before the fix:
module.exports = {
// standard table configuration, ports etc
};
module.exports = {
// defaulting to a release of dynamodb as latest version needs some changes to the environment variables
// References: https://github.com/shelfio/jest-dynamodb/issues/212
// https://repost.aws/articles/ARc4hEkF9CRgOrw8kSMe6CwQ/troubleshooting-the-access-key-id-or-security-token-is-invalid-error-after-upgrading-dynamodb-local-to-version-2-0-or-greater
installerConfig: {
downloadUrl: 'https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/dynamodb_local_2023-06-09.tar.gz',
},
// standard table configuration, ports etc
};
Have been using
@shelf/jest-dynamodb
for 2 yrs and just started getting this error in github actions (not locally)package.json
test/file.test.ts
src/file.ts
github actions: