Closed wthorp closed 2 years ago
On a release binary, this behaves quite differently, which sets the --defaults
flag to release
by default and supresses a whole bunch of backtraces and verbose output. This is done by the storj/private process package automatically.
See the difference if it's set correctly:
gateway run --defaults release
2021-11-02T19:02:29.369+1300 INFO Telemetry enabled {"instance ID": "54:05:db:37:35:0f"}
2021-11-02T19:02:29.369+1300 INFO Starting Storj DCS S3 Gateway
2021-11-02T19:02:29.369+1300 INFO Endpoint: 127.0.0.1:7777
2021-11-02T19:02:29.369+1300 INFO Access key: insecure-dev-access-key
2021-11-02T19:02:29.369+1300 INFO Secret key: insecure-dev-secret-key
Error: gateway setup error: uplink: invalid access grant format
Given this, I'm not sure if we should change anything here for dev mode, as it's supposed to be more verbose by design? The error message could perhaps be a bit more helpful, and maybe we could remove the backtrace for errors in this validation context.
Should we limit the stack trace depth?
I think we could do that. I'm having a look at the zap API to see if there's any way to control showing a backtrace on a per-log event basis. I think it's only enable or disable for the entire logger instance at creation, not so much at runtime. Perhaps we could create another logger specifically for validation that has the backtrace disabled or limited (?)
Currently a bad config results in a noisy stack trace. Validate configs up front with friendlier error messages.