1

I'm using s3cmd to access the Ceph storage provided by my cloud provider. I created a minimal .s3cfg file on my VM to do so. When I try to list buckets, it claims that it can't find the configuration file despite --debug output showing that it's parsing it:

$ s3cmd ls --debug
DEBUG: s3cmd version 1.6.1
DEBUG: ConfigParser: Reading file '/home/ubuntu/.s3cfg'
DEBUG: ConfigParser: access_key->...-3_chars...
DEBUG: ConfigParser: secret_key->...-3_chars...
DEBUG: ConfigParser: enable_multipart->True
DEBUG: ConfigParser: host_base->storage.datacentred.io
DEBUG: ConfigParser: host_bucket->%(bucket)s.storage.datacentred.io
DEBUG: ConfigParser: use_https->True
ERROR: /home/ubuntu/.s3cfg: None
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.

I am using Ubuntu 16.04.2 LTS. Any idea what I'm doing wrong? Is there a key property that is missing that would make s3cmd believe the file doesn't exist?

Bruno Girin
  • 175
  • 2
  • 10

1 Answers1

4

The prior line /home/ubuntu/.s3cfg: None, says there is some error parsing your configuration file. The None unfortunately means whatever the error was doesn't have a nice string to display :-(.

Here's the relevant block of s3cmd source:

try: 
    cfg = Config(options.config, options.access_key, options.secret_key, options.access_token)
except IOError, e:
    if options.run_configure:
        cfg = Config()
    else:
        error(u"%s: %s"  % (options.config, e.strerror))
        error(u"Configuration file not available.")
robbat2
  • 1,154
  • 10
  • 12
  • 1
    Indeed. I filed a bug here: https://github.com/s3tools/s3cmd/issues/903 and it appears that my issue is due to missing `secret_key` and `access_key` values and is a duplicate of: https://github.com/s3tools/s3cmd/issues/834 Thanks for highlighting the relevant part of the code, it might help fix this issue. – Bruno Girin Aug 22 '17 at 09:25
  • approve this answer then? I'd patch upstream for you, but they note they have a rewrite of that code in process. – robbat2 Aug 22 '17 at 18:24