Closed frontierpsycho closed 8 years ago
Hum, that is very strange, you are accessing a part of code that you are not supposed to reach based on your environment. Also, I'm not able to reproduce your issue. Could you try the following command and past the output please? s3cmd -d --configure
Not much difference:
$ s3cmd -d --configure
DEBUG: ConfigParser: Reading file '/home/username/.s3cfg'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please try reproducing the error using
the latest s3cmd code from the git master
branch found at:
https://github.com/s3tools/s3cmd
and have a look at the known issues list:
https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
If the error persists, please report the
following lines (removing any private
info as necessary) to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DEBUG: Unicodising '/usr/local/bin/s3cmd' using UTF-8
DEBUG: Unicodising '-d' using UTF-8
DEBUG: Unicodising '--configure' using UTF-8
Invoked as: /usr/local/bin/s3cmd -d --configure
Problem: KeyError: 'key'
S3cmd: 1.6.0
python: 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2]
environment LANG=sv_SE.UTF-8
Traceback (most recent call last):
File "/usr/local/bin/s3cmd", line 2805, in <module>
rc = main()
File "/usr/local/bin/s3cmd", line 2526, in main
cfg = Config(options.config, options.access_key, options.secret_key)
File "/usr/local/lib/python2.7/dist-packages/S3/Config.py", line 144, in __init__
self.env_config()
File "/usr/local/lib/python2.7/dist-packages/S3/Config.py", line 221, in env_config
del data["key"]
KeyError: 'key'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please try reproducing the error using
the latest s3cmd code from the git master
branch found at:
https://github.com/s3tools/s3cmd
and have a look at the known issues list:
https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions
If the error persists, please report the
above lines (removing any private
info as necessary) to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
username@mycomputer:~ $ cat ~/.s3cfg
cat: /home/username/.s3cfg: No such file or directory
Hum, can you do a "env" command in your shell and showing me the output? (ensure that you don't have sensitive info in there before sending it)
I don't believe there's anything sensitive in there (I skimmed through it):
XDG_VTNR=7
MANPATH=/home/username/.nvm/versions/node/v0.12.7/share/man:/home/username/.rvm/rubies/ruby-2.2.0/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/home/username/.rvm/man
XDG_SESSION_ID=1
SSH_AGENT_PID=2185
KDE_MULTIHEAD=false
rvm_bin_path=/home/username/.rvm/bin
DM_CONTROL=/var/run/xdmctl
COMP_WORDBREAKS=
"'><;|&(:
GEM_HOME=/home/username/.rvm/gems/ruby-2.2.0
TERM=screen-256color
SHELL=/bin/bash
XDM_MANAGED=method=classic
KONSOLE_DBUS_SERVICE=:1.48
IRBRC=/home/username/.rvm/rubies/ruby-2.2.0/.irbrc
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/username/.gtkrc-2.0:/home/username/.kde/share/config/gtkrc-2.0
NVM_PATH=/home/username/.nvm/versions/node/v0.12.7/lib/node
KONSOLE_PROFILE_NAME=Shell
GTK_RC_FILES=/etc/gtk/gtkrc:/home/username/.gtkrc:/home/username/.kde/share/config/gtkrc
GS_LIB=/home/username/.fonts
WINDOWID=65011738
SHELL_SESSION_ID=49cf1487264c4000a131ccec711c4c4b
MY_RUBY_HOME=/home/username/.rvm/rubies/ruby-2.2.0
POWERLINE_COMMAND=powerline
KDE_FULL_SESSION=true
rvm_stored_umask=0022
USER=username
SVN_EDITOR=vim
NVM_DIR=/home/username/.nvm
XCURSOR_SIZE=0
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
_system_type=Linux
rvm_path=/home/username/.rvm
SSH_AUTH_SOCK=/tmp/ssh-wpZFdfI3UGEg/agent.2090
AWS_CREDENTIAL_FILE=/home/username/.aws/credentials
SESSION_MANAGER=local/mycomputer:@/tmp/.ICE-unix/2302,unix/mycomputer:/tmp/.ICE-unix/2302
TMUX=/tmp/tmux-1000/default,4742,0
rvm_prefix=/home/username
PATH=/home/username/.rvm/gems/ruby-2.2.0/bin:/home/username/.rvm/gems/ruby-2.2.0@global/bin:/home/username/.rvm/rubies/ruby-2.2.0/bin:/home/username/.nvm/versions/node/v0.12.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin:/home/username/.rvm/bin:/home/username/.rvm/bin
DESKTOP_SESSION=default
rvm_loaded_flag=1
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
PWD=/home/username/Software/s3restoration/data
LANG=sv_SE.UTF-8
KDE_SESSION_UID=1000
NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
_system_arch=x86_64
TMUX_PANE=%70
_system_version=8
KONSOLE_DBUS_SESSION=/Sessions/1
rvm_version=1.26.10 (latest)
POWERLINE_CONFIG_COMMAND=powerline-config
XDG_SEAT=seat0
SHLVL=2
HOME=/home/username
COLORFGBG=15;0
LANGUAGE=en_US:en
KDE_SESSION_VERSION=4
XCURSOR_THEME=Ring-Orange
LOGNAME=username
XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share
GEM_PATH=/home/username/.rvm/gems/ruby-2.2.0:/home/username/.rvm/gems/ruby-2.2.0@global
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-B9T1EorqE3,guid=4cbd4e61fa786e9b4b284749565c0471
TMUX_PLUGIN_MANAGER_PATH=/home/username/.tmux/plugins/
NVM_BIN=/home/username/.nvm/versions/node/v0.12.7/bin
GOPATH=/home/username/.go
NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
WINDOWPATH=7
XDG_RUNTIME_DIR=/run/user/1000
PROFILEHOME=
DISPLAY=:0
QT_PLUGIN_PATH=/home/username/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/
XDG_CURRENT_DESKTOP=KDE
RUBY_VERSION=ruby-2.2.0
rvm_user_install_flag=1
_system_name=Debian
_=/usr/bin/env
Ok, I see, s3cmd try to pre-load the credentials that you have saved with aws cli, and this code is not so great. I will fix that in a few minute in master. On your side, there is an easy workaround with the release version of s3cmd that you have: Remove or move somewhere else the file "/home/username/.aws/credentials". Once you will have done the "configuration", you will be able to restore this file without affecting s3cmd.
In the meantime, I would be curious to see what is inside your ".aws/credentials" file. Can you past here the content? WARNING WARNING: There are your credentials inside, so please scramble them before pasting. I'm interested in "key" names that we can find inside.
AWS_CREDENTIAL_FILE=/home/username/.aws/credentials is taking you down this rathole.
On Wed, Dec 9, 2015 at 7:52 AM, Nameless notifications@github.com wrote:
I don't believe there's anything sensitive in there (I skimmed through it):
XDG_VTNR=7 MANPATH=/home/username/.nvm/versions/node/v0.12.7/share/man:/home/username/.rvm/rubies/ruby-2.2.0/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/home/username/.rvm/man XDG_SESSION_ID=1 SSH_AGENT_PID=2185 KDE_MULTIHEAD=false rvm_bin_path=/home/username/.rvm/bin DM_CONTROL=/var/run/xdmctl COMP_WORDBREAKS= "'><;|&(: GEM_HOME=/home/username/.rvm/gems/ruby-2.2.0 TERM=screen-256color SHELL=/bin/bash XDM_MANAGED=method=classic KONSOLE_DBUS_SERVICE=:1.48 IRBRC=/home/username/.rvm/rubies/ruby-2.2.0/.irbrc GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/username/.gtkrc-2.0:/home/username/.kde/share/config/gtkrc-2.0 NVM_PATH=/home/username/.nvm/versions/node/v0.12.7/lib/node KONSOLE_PROFILE_NAME=Shell GTK_RC_FILES=/etc/gtk/gtkrc:/home/username/.gtkrc:/home/username/.kde/share/config/gtkrc GS_LIB=/home/username/.fonts WINDOWID=65011738 SHELL_SESSION_ID=49cf1487264c4000a131ccec711c4c4b MY_RUBY_HOME=/home/username/.rvm/rubies/ruby-2.2.0 POWERLINE_COMMAND=powerline KDE_FULL_SESSION=true rvm_stored_umask=0022 USER=username SVN_EDITOR=vim NVM_DIR=/home/username/.nvm XCURSOR_SIZE=0 LSCOLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35! :.qt=01; 35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga=00;36:.spx=00;36:_.xspf=00;36: _system_type=Linux rvm_path=/home/username/.rvm SSH_AUTH_SOCK=/tmp/ssh-wpZFdfI3UGEg/agent.2090 AWS_CREDENTIAL_FILE=/home/username/.aws/credentials SESSION_MANAGER=local/mycomputer:@/tmp/.ICE-unix/2302,unix/mycomputer:/tmp/.ICE-unix/2302 TMUX=/tmp/tmux-1000/default,4742,0 rvm_prefix=/home/username PATH=/home/username/.rvm/gems/ruby-2.2.0/bin:/home/username/.rvm/gems/ruby-2.2.0@global/bin:/home/username/.rvm/rubies/ruby-2.2.0/bin:/home/username/.nvm/versions/node/v0.12.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin:/home/username/.rvm/bin:/home/username/.rvm/bin DESKTOP_SESSION=default rvm_loaded_flag=1 NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist PWD=/home/username/Software/s3restoration/data LANG=sv_SE.UTF-8 KDE_SESSION_UID=1000 NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript _system_arch=x86_64 TMUX_PANE=%70 _system_version=8 KONSOLE_DBUS_SESSION=/Sessions/1 rvm_version=1.26.10 https://nodejs.org/distPWD=/home/username/Software/s3restoration/dataLANG=sv_SE.UTF-8KDE_SESSION_UID=1000NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript_system_arch=x86_64TMUX_PANE=%70_system_version=8KONSOLE_DBUS_SESSION=/Sessions/1rvm_version=1.26.10 (latest) POWERLINE_CONFIG_COMMAND=powerline-config XDG_SEAT=seat0 SHLVL=2 HOME=/home/username COLORFGBG=15;0 LANGUAGE=en_US:en KDE_SESSION_VERSION=4 XCURSOR_THEME=Ring-Orange LOGNAME=username XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share GEM_PATH=/home/username/.rvm/gems/ruby-2.2.0:/home/username/.rvm/gems/ruby-2.2.0@global DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-B9T1EorqE3,guid=4cbd4e61fa786e9b4b284749565c0471 TMUX_PLUGIN_MANAGER_PATH=/home/username/.tmux/plugins/ NVM_BIN=/home/username/.nvm/versions/node/v0.12.7/bin GOPATH=/home/username/.go NVM_IOJS_ORG_MIRROR=https://iojs.org/dist WINDOWPATH=7 XDG_RUNTIME_DIR=/run/user/1000 https://iojs.org/distWINDOWPATH=7XDG_RUNTIME_DIR=/run/user/1000 PROFILEHOME= DISPLAY=:0 QT_PLUGIN_PATH=/home/username/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/ XDG_CURRENT_DESKTOP=KDE RUBY_VERSION=ruby-2.2.0 rvm_user_install_flag=1 _systemname=Debian =/usr/bin/env
— Reply to this email directly or view it on GitHub https://github.com/s3tools/s3cmd/issues/674#issuecomment-163242258.
I have this:
[Credentials]
aws_access_key_id=<redacted>
aws_secret_access_key=<redacted>
[<other-AWS-IAM>]
aws_access_key_id=<redacted>
aws_secret_access_key=<redacted>
I redacted some stuff.
I don't remember why I put that other AWS IAM credentials in there. I think I did it manually, based on something I read in AWS's docs. Don't remember now.
Note: I just noticed that we were looking for: AWSAccessKeyId and AWSSecretKey as keys, but the format looks like to be that now: aws_access_key_id and aws_secret_access_key
Glad to report something actual :)
That should be fixed in master now, thank your very much for your report!
You're welcome. Also: I tried the workaround and it worked just fine. Thanks!
Hi, I am still facing this problem. Tried the latest master and still same error. Any idea on the workaround ? Thank You
Hello! I also encountered this problem [root@hxq-v4-1 ~]# s3cmd -d --configure DEBUG: s3cmd version 2.3.0 DEBUG: ConfigParser: Reading file '/root/.s3cfg'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! An unexpected error has occurred. Please try reproducing the error using the latest s3cmd code from the git master branch found at: https://github.com/s3tools/s3cmd and have a look at the known issues list: https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions-(FAQ) If the error persists, please report the following lines (removing any private info as necessary) to: s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DEBUG: Unicodising '/usr/bin/s3cmd' using UTF-8 DEBUG: Unicodising '-d' using UTF-8 DEBUG: Unicodising '--configure' using UTF-8 Invoked as: /usr/bin/s3cmd -d --configure Problem: BadStatusLine: '' S3cmd: 2.3.0 python: 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] environment LANG=en_US.UTF-8
Traceback (most recent call last):
File "/usr/bin/s3cmd", line 3286, in
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! An unexpected error has occurred. Please try reproducing the error using the latest s3cmd code from the git master branch found at: https://github.com/s3tools/s3cmd and have a look at the known issues list: https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions-(FAQ) If the error persists, please report the above lines (removing any private info as necessary) to: s3tools-bugs@lists.sourceforge.net !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[root@hxq-v4-1 ~]#
How to solve this problem
I'm trying to use s3cmd on Debian. I installed the latest version using
sudo pip install s3cmd
, and then I rans3cmd --configure
. I get this error:I also tried with Debian's repo version (1.5.0rc1 or somesuch) and I got the exact same.
I have no .s3cfg in my home folder.