Unhelpful errors resulting from a bad storage.yml key

A few months ago, a developer on my team had a brain fart and called a key in our storage.yml by a wrong but plausible-sounding name.

The error we saw varied. If it was right after a restart, we saw one error; on the next request after and all subsequent requests, we saw another. I do not remember much if anything about one of these errors – maybe it was in the aws-s3 gem? Maybe in ActiveStorage itself? The other was in seahorse, which is an aws-s3 dependency. I do not remember which error was the “after restart” error and which error was the “all subsequent requests” error.

However, I do remember that neither of them was the kind of error that would lead a reasonable person to diagnose “storage.yml typo” as the cause.

1 Like

Not sure if you were using the aws-sdk-rails gem but they recently fixed this issue where they were trying to read every aws.* key from within the Rails credentials file. We had some of our own aws.* keys defined beyond what are valid to pass into Aws.config.merge!. The generic ArgumentError (invalid configuration option ...) error was really confusing to debug but they’ve now fixed it here with a whitelist.

We weren’t, and we don’t use Rails’s credentials file.

I usually end up having to copy the contents of the yml file which I’d then run through an online validator when trying to see where the error came from.