Search code examples
ubuntu-16.04s3cmdceph

s3cmd reads configuration file but claims it doesn't exist


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?


Solution

  • 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.")