-
Notifications
You must be signed in to change notification settings - Fork 14
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
Instance is running, but unavailable #9
Comments
I think I'm running into the same issue. I'll try to look into this shortly. Really have no idea what is going on here at first glance. It's strange that running it as a service doesn't work either. This GitHub Action is pretty simple, so really thinking it's more a result of GitHub Actions as opposed to anything this action is doing wrong. |
I could not reproduce this in a blank test repository. I have no idea why. But you can see the results and play around with it yourself at: https://github.com/fishcharlie/DynamoDBGHActionTest. However, this was still an issue for one of my projects. So what I ended up doing is running the following script right after setting up DynamoDB Local: const { DynamoDBClient, ListTablesCommand } = require('@aws-sdk/client-dynamodb');
const client = new DynamoDBClient({ region: 'us-west-2', endpoint: 'http://localhost:8000', credentials: { accessKeyId: 'fake', secretAccessKey: 'fake' } });
const startTime = new Date().getTime();
const TIMEOUT = 10000; // 10 seconds
async function check() {
try {
await client.send(new ListTablesCommand({}));
console.log("Success. Local DynamoDB is running.");
process.exit(0);
} catch (err) {
if (new Date().getTime() - startTime > TIMEOUT) {
console.log(`Error: Local DynamoDB is not running after ${TIMEOUT / 1000} seconds. Exiting...`);
process.exit(1);
}
console.log("Error: Local DynamoDB is not running. Waiting for 100 milliseconds and retrying...");
await timeout(100);
check();
}
}
check();
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
} The logs printed out the following for me:
That ended up running for 3 seconds according to GitHub Actions (maybe there was a long start up time???). I'm willing to consider adding a flag within this Action to run a similar script automatically. But would like some feedback before I move forward with that. Does the script above solve this problem for anyone else? Would you like to see a flag within this Action to do this automatically? |
Hi!
When using dynamodb-action for unit tests on ubuntu-latest with actions, the instance is running, netstat shows something at 8000. But running lsof -i :8000 exits with 1 indicating the instance is unavailable.
netstat log on port 8000:
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN
Here is the workflow file:
The same situation is happening when using amazon/dynamodb-local with services
Here is the config:
Stuck on this isssue, wondering whether there is a problem with Github-actions, DynamoDB or config, I would appreciate any assistance on this 😅
The text was updated successfully, but these errors were encountered: