2016-07-18 6 views
7

Ich versuche meine lokale s3ninja mit s3cmd zu verwenden. Jeder Befehl wie: s3cmd ls s3://test löst die gleichen Ausnahmen.S3Cmd funktioniert nicht mit S3 Ninja

Die s3cfg scheint in Ordnung zu sein und die aufgerufenen Endpunkte sind korrekt.

Kann jemand s3ninja mit s3cmd benutzen?

PS: Ich weiß, S3 ist nicht teuer und es gibt viele bessere Möglichkeiten, gegen S3 zu testen. Ich brauche S3 Ninja aus anderen Gründen. Hier

ist die Debug-Informationen:

DEBUG: ConfigParser: Reading file '/Users/daniel/.s3cfg' 
DEBUG: ConfigParser: access_key->AK...17_chars...E 
DEBUG: ConfigParser: access_token-> 
DEBUG: ConfigParser: add_encoding_exts-> 
DEBUG: ConfigParser: add_headers-> 
DEBUG: ConfigParser: bucket_location->US 
DEBUG: ConfigParser: ca_certs_file-> 
DEBUG: ConfigParser: cache_file-> 
DEBUG: ConfigParser: check_ssl_certificate->True 
DEBUG: ConfigParser: check_ssl_hostname->True 
DEBUG: ConfigParser: cloudfront_host->cloudfront.amazonaws.com 
DEBUG: ConfigParser: default_mime_type->binary/octet-stream 
DEBUG: ConfigParser: delay_updates->False 
DEBUG: ConfigParser: delete_after->False 
DEBUG: ConfigParser: delete_after_fetch->False 
DEBUG: ConfigParser: delete_removed->False 
DEBUG: ConfigParser: dry_run->False 
DEBUG: ConfigParser: enable_multipart->True 
DEBUG: ConfigParser: encoding->UTF-8 
DEBUG: ConfigParser: encrypt->False 
DEBUG: ConfigParser: expiry_date-> 
DEBUG: ConfigParser: expiry_days-> 
DEBUG: ConfigParser: expiry_prefix-> 
DEBUG: ConfigParser: follow_symlinks->False 
DEBUG: ConfigParser: force->False 
DEBUG: ConfigParser: get_continue->False 
DEBUG: ConfigParser: gpg_command->None 
DEBUG: ConfigParser: gpg_decrypt->%(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s 
DEBUG: ConfigParser: gpg_encrypt->%(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s 
DEBUG: ConfigParser: gpg_passphrase->...-3_chars... 
DEBUG: ConfigParser: guess_mime_type->True 
DEBUG: ConfigParser: host_base->s3.mylocalaws.com:9444/s3 
DEBUG: ConfigParser: host_bucket->s3.mylocalaws.com:9444/s3/%(bucket)s 
DEBUG: ConfigParser: human_readable_sizes->False 
DEBUG: ConfigParser: invalidate_default_index_on_cf->False 
DEBUG: ConfigParser: invalidate_default_index_root_on_cf->True 
DEBUG: ConfigParser: invalidate_on_cf->False 
DEBUG: ConfigParser: kms_key-> 
DEBUG: ConfigParser: limitrate->0 
DEBUG: ConfigParser: list_md5->False 
DEBUG: ConfigParser: log_target_prefix-> 
DEBUG: ConfigParser: long_listing->False 
DEBUG: ConfigParser: max_delete->-1 
DEBUG: ConfigParser: mime_type-> 
DEBUG: ConfigParser: multipart_chunk_size_mb->15 
DEBUG: ConfigParser: preserve_attrs->True 
DEBUG: ConfigParser: progress_meter->True 
DEBUG: ConfigParser: proxy_host-> 
DEBUG: ConfigParser: proxy_port->0 
DEBUG: ConfigParser: put_continue->False 
DEBUG: ConfigParser: recursive->False 
DEBUG: ConfigParser: recv_chunk->65536 
DEBUG: ConfigParser: reduced_redundancy->False 
DEBUG: ConfigParser: requester_pays->False 
DEBUG: ConfigParser: restore_days->1 
DEBUG: ConfigParser: secret_key->wJ...37_chars...Y 
DEBUG: ConfigParser: send_chunk->65536 
DEBUG: ConfigParser: server_side_encryption->False 
DEBUG: ConfigParser: signature_v2->False 
DEBUG: ConfigParser: simpledb_host->sdb.amazonaws.com 
DEBUG: ConfigParser: skip_existing->False 
DEBUG: ConfigParser: socket_timeout->300 
DEBUG: ConfigParser: stop_on_error->False 
DEBUG: ConfigParser: storage_class-> 
DEBUG: ConfigParser: urlencoding_mode->normal 
DEBUG: ConfigParser: use_https->False 
DEBUG: ConfigParser: use_mime_magic->True 
DEBUG: ConfigParser: verbosity->WARNING 
DEBUG: ConfigParser: website_endpoint->http://%(bucket)s.s3-website-%(location)s.amazonaws.com/ 
DEBUG: ConfigParser: website_error-> 
DEBUG: ConfigParser: website_index->index.html 
DEBUG: Updating Config.Config cache_file -> 
DEBUG: Updating Config.Config follow_symlinks -> False 
DEBUG: Updating Config.Config verbosity -> 10 
DEBUG: Unicodising 'ls' using UTF-8 
DEBUG: Unicodising 's3://test' using UTF-8 
DEBUG: Command: ls 
DEBUG: Bucket 's3://test': 
DEBUG: CreateRequest: resource[uri]=/ 
DEBUG: Using signature v4 
DEBUG: get_hostname(test): s3.mylocalaws.com:9444/s3/test 
DEBUG: canonical_headers = host:s3.mylocalaws.com:9444/s3/test 
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 
x-amz-date:20160718T104632Z 

DEBUG: Canonical Request: 
GET 
/
delimiter=%2F 
host:s3.mylocalaws.com:9444/s3/test 
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 
x-amz-date:20160718T104632Z 

host;x-amz-content-sha256;x-amz-date 
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 
---------------------- 
DEBUG: signature-v4 headers: {'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20160718/US/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=f58c63587c00d0c01122db06cf0b8a7376a2484b0572db3c562edddbd6d2fdb1', 'x-amz-date': '20160718T104632Z'} 
DEBUG: Processing request, please wait... 
DEBUG: get_hostname(test): s3.mylocalaws.com:9444/s3/test 
DEBUG: ConnMan.get(): creating new connection: http://s3.mylocalaws.com:9444/s3/test 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    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: 
    [email protected] 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

DEBUG: Unicodising '/usr/local/bin/s3cmd' using UTF-8 
DEBUG: Unicodising 'ls' using UTF-8 
DEBUG: Unicodising 's3://test' using UTF-8 
DEBUG: Unicodising '--debug' using UTF-8 
Invoked as: /usr/local/bin/s3cmd ls s3://test --debug 
Problem: UnboundLocalError: local variable 'conn' referenced before assignment 
S3cmd: 1.6.0 
python: 2.7.11 (default, Jan 22 2016, 08:29:18) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] 
environment LANG=de_DE.UTF-8 

Traceback (most recent call last): 
    File "/usr/local/bin/s3cmd", line 2805, in <module> 
    rc = main() 
    File "/usr/local/bin/s3cmd", line 2713, in main 
    rc = cmd_func(args) 
    File "/usr/local/bin/s3cmd", line 120, in cmd_ls 
    subcmd_bucket_list(s3, uri) 
    File "/usr/local/bin/s3cmd", line 153, in subcmd_bucket_list 
    response = s3.bucket_list(bucket, prefix = prefix) 
    File "/usr/local/lib/python2.7/site-packages/S3/S3.py", line 293, in bucket_list 
    for dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params): 
    File "/usr/local/lib/python2.7/site-packages/S3/S3.py", line 320, in bucket_list_streaming 
    response = self.bucket_list_noparse(bucket, prefix, recursive, uri_params) 
    File "/usr/local/lib/python2.7/site-packages/S3/S3.py", line 339, in bucket_list_noparse 
    response = self.send_request(request) 
    File "/usr/local/lib/python2.7/site-packages/S3/S3.py", line 1084, in send_request 
    conn.counter = ConnMan.conn_max_counter 
UnboundLocalError: local variable 'conn' referenced before assignment 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    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: 
    [email protected] 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+0

das funktioniert immer noch nicht. -.- –

Antwort

3

s3cmd zur Zeit api Kräfte / zu sein. Auf der anderen Seite erlaubt es s3ninja nicht, es auf '/' zu setzen. Ich habe Feature (PR 781) vorgeschlagen, mit s3cmd umzugehen - Sie könnten s3cmd selbst patchen.

Eine andere Lösung wäre, einen Proxy z. nginx />/s3

+0

Sie haben dieses Kopfgeld mit Sicherheit verdient! Genau das habe ich vor ein paar Tagen getan (Proxy). Ich werde bald eine weitere Antwort mit der Proxy-Konfiguration hinzufügen. –

1

Dies ist meine Nginx-Proxy-Konfiguration, die perfekt mit s3cmd und S3 Ninja funktioniert.

server { 
     listen 80; 
     server_name s3.eu-central-1.amazonaws.com; 

     location/{ 
      proxy_pass   http://127.0.0.1:9444/s3/; 
     } 
    } 

Mit der folgenden Host-Konfiguration:

host_base = s3.eu-central-1.amazonaws.com 
host_bucket = s3.eu-central-1.amazonaws.com 

Und Sie brauchen einen Eintrag in/etc/hosts hinzuzufügen:

127.0.0.1 s3.eu-central-1.amazonaws.com 

Dies auch mit einem Reverse-Proxy arbeitet und https.

0

S3cmd verwendet AWS-Endpunkte und ist nicht bereit für die Arbeit mit S3-kompatiblen Schnittstellen. Es schlägt fehl beim Versuch, "Bucket Location" zu bekommen. .

--bucket-location=BUCKET_LOCATION 

Rechenzentrum zu schaffen Eimer in Ab sofort sind die Datenzentren sind: US (Standard), EU, us-west-1 und AP-S-1

http://linux.die.net/man/1/s3cmd

Verwandte Themen