s3tools / s3cmd

Official s3cmd repo -- Command line tool for managing S3 compatible storage services (including Amazon S3 and CloudFront).
https://s3tools.org/s3cmd
GNU General Public License v2.0
4.61k stars 906 forks source link

Something is wrong #845

Open clearly opened 7 years ago

clearly commented 7 years ago
[MYUSER@MYHOST ~]$ stat .s3cfg 
  File: `.s3cfg'
  Size: 1889            Blocks: 8          IO Block: 4096   regular file
Device: fd02h/64770d    Inode: 524485      Links: 1
Access: (0644/-rw-r--r--)  Uid: (50441/ MYUSER)   Gid: (50441/ MYUSER)
Access: 2017-03-18 09:05:37.607081332 -0400
Modify: 2017-03-18 08:58:15.065920709 -0400
Change: 2017-03-18 09:05:32.978082163 -0400
[MYUSER@MYHOST ~]$ s3cmd ls s3://commoncrawl
ERROR: /home/MYUSER/.s3cfg: None
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.
fviard commented 7 years ago

@clearly From the same console, does the command: "cat /home/MYUSER/.s3cfg" works? I guess that you scrambled the MYUSER in the console, but have you checked that it is not something related with running something with sudo or having done it. And so the user is not really the user? Like check if the check or the .s3cfg file is not in /root/ ?

fviard commented 7 years ago

@clearly Ping?

luckyr14 commented 6 years ago

/home/ubuntu# s3cmd ls s3://lucky237 ERROR: /root/.s3cfg: None ERROR: Configuration file not available. ERROR: Consider using --configure parameter to create one. I have also same issue

fviard commented 6 years ago

@luckyr14 Can you run your command with the "-d" ? It might in fact be a "parsing" issue of your config file that makes the config loading failed. There error message just being the wrong one.

ysimonson commented 5 years ago

I'm seeing this issue as well. -d prints a bunch of debug messages of the parsed config values, with no apparent error. Here's the last few lines:

$ s3cmd -d ls
...
DEBUG: ConfigParser: website_endpoint->http://%(bucket)s.s3-website-%(location)s.amazonaws.com/
DEBUG: ConfigParser: website_error->
DEBUG: ConfigParser: website_index->index.html
ERROR: /home/ysimonson/.s3cfg: None
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.

I've configured s3cmd to point to a local server with an S3-like API. I bet it has something to do with that.

ysimonson commented 5 years ago

Yep, that was it for me:

1) AWS access/secret keys weren't set, so s3cmd implicitly made an API call to find out what it is 2) The S3-like API I'm working on doesn't support that API call and gave a 404 3) The config parser captures all IOErrors and assumes it happened because the config file doesn't exist

Ideally, it would only give this error if the config file really doesn't exist, rather than for any IOError. I'm not sure if other people are facing the same issue though.

rkazakov commented 2 years ago

I am facing the same issue. Has anyone successfully fixed it?

Quixotical commented 2 years ago

@rkazakov the issue here was that the environment variables weren't set, so it threw an error and called it an IOError (Not found) as @ysimonson had explained.

459below commented 10 months ago

2.3.0 for me still shows up with this error message

ERROR: /home/.s3cfg: Connection refused
ERROR: Configuration file not available.
ERROR: Consider using --configure parameter to create one.

When the config file does not exist or it does exist and something like the S3 Endpoint is not set. This is a very misleading error message.