Trouble with s3: Failed to open TCP connection to 169.254.169.254 due to missing secret access key

This is a standard install. These credentials work on the old server and they work on the new server using s3cmd, but when I do a discourse restore to try to get a list of backups, I get

Error retrieving instance profile credentials: Failed to open TCP connection to 169.254.169.254:80 (execution expired)

This is a sho’nuff AWS bucket. It doesn’t make any sense that it could be an issue with Discourse, but none of the other things I can come up with make sense either.

This is for what may be one of the first self-hosted forums that I’m trying to move to a new server with Ubuntu 24.04.

The AWS client is attempting to connect to the EC2 metadata service to retrieve its instance profile credentials.

If that worked, it would then use these credentials to attempt to connect to the bucket.

But, it can’t connect to the metadata service. It isn’t even trying to connect to the bucket yet, it’s failing before that.

Is this on AWS? If not, that explains why it can’t talk to the metadata service.

The new install does not see any credentials, that’s why the AWS SDK is attempting to connect to the metadata service to retrieve them.

1 Like

OMG. I thought I was going crazy.

I had

DISCOURSE_S3_SECRET_ACCESS=xxx

rather than

DISCOURSE_S3_SECRET_ACCESS_KEY=xxx
4 Likes