journeymidnight / yig

An open source object storage server with Amazon S3 compatible API
Apache License 2.0
360 stars 86 forks source link

ERROR: S3 error: 405 (Method Not Allowed) #309

Closed baojunnj closed 3 years ago

baojunnj commented 3 years ago

Describe the bug 我这边初次安装yig,然后使用s3cmd测试时,使用s3cmd ls 是OK的,但在创建bucket的时候会返回405(Method Not Allowed)错误,无论是debug模式下的(hehehehe)账号还是iam账号。 返回的日志信息如下: 2020/10/20 21:52:03.878296 cache.go:71 [INFO] enabledSimpleMetaCache.Get table: 1 key: test 2020/10/20 21:52:03.886296 bucket.go:15 [INFO] GetBucket CacheMiss. bucket: test 2020/10/20 21:52:03.886359 cache.go:88 [ERROR] exec onCacheMiss() err: The specified bucket does not exist 2020/10/20 21:52:03.886424 generic-handlers.go:254 IEUUK4R27P0QNI26 [INFO] BucketName: test, ObjectName: , BucketInfo: , ObjectInfo: , AuthType: 6 2020/10/20 21:52:03.886458 log-handler.go:16 IEUUK4R27P0QNI26 [INFO] Start serving GET 10.30.130.22 /test/?location 20 Url of GetCredential send request to IAM : http://127.0.0.1:8888/api/v1/yig/fetchsecretkey 20 GetCredential to IAM return status 200 OK 2020/10/20 21:52:03.891092 cache.go:71 [INFO] enabledSimpleMetaCache.Get table: 0 key: p-1FxlqtBtUEI7NQup 2020/10/20 21:52:03.893593 log-handler.go:18 IEUUK4R27P0QNI26 [INFO] Completed GET 10.30.130.22 /test/?location 2020/10/20 21:52:03.894021 access-log-handler.go:87 [INFO] Succeed to send message [map[body_bytes_sent:242 bucket_name:test error_code:- host_name:10.30.130.22 http_referer:"-" http_status:200 http_user_agent:"-" http_x_real_ip:- object_name:- object_size:0 operation_name:ListBuckets project_id:- remote_addr:10.30.130.22:41896 request_id:IEUUK4R27P0QNI26 request_length:0 request_time:7 request_uri:GET /test/?location HTTP/1.1 requester_id:p-1FxlqtBtUEI7NQup server_cost:7 time_local:[2020-10-20 21:52:03]]] to message queue. 2020/10/20 21:52:03.898765 cache.go:71 [INFO] enabledSimpleMetaCache.Get table: 1 key: test 2020/10/20 21:52:03.901148 bucket.go:15 [INFO] GetBucket CacheMiss. bucket: test 2020/10/20 21:52:03.901196 cache.go:88 [ERROR] exec onCacheMiss() err: The specified bucket does not exist 2020/10/20 21:52:03.901252 generic-handlers.go:254 Y9QMJK9FH9N6K92X [INFO] BucketName: test, ObjectName: , BucketInfo: , ObjectInfo: , AuthType: 6 2020/10/20 21:52:03.901275 log-handler.go:16 Y9QMJK9FH9N6K92X [INFO] Start serving PUT 10.30.130.22 /test/ 2020/10/20 21:52:03.901356 log-handler.go:18 Y9QMJK9FH9N6K92X [INFO] Completed PUT 10.30.130.22 /test/ 2020/10/20 21:52:03.901628 access-log-handler.go:87 [INFO] Succeed to send message [map[body_bytes_sent:0 bucket_name:test error_code:- host_name:10.30.130.22 http_referer:"-" http_status:200 http_user_agent:"-" http_x_real_ip:- object_name:- object_size:0 operation_name:- project_id:- remote_addr:10.30.130.22:41896 request_id:Y9QMJK9FH9N6K92X request_length:0 request_time:0 request_uri:PUT /test/ HTTP/1.1 requester_id:p-1FxlqtBtUEI7NQup server_cost:0 time_local:[2020-10-20 21:52:03]]] to message queue.

我的配置文件如下: s3domain = ["s3.test.com"] region = "cn-bj-1" log_path = "/var/log/yig/yig.log" access_log_path = "/var/log/yig/access.log" access_log_format = "{combined}" panic_log_path = "/var/log/yig/panic.log" log_level = "info" pid_file = "/var/run/yig/yig.pid" api_listener = "0.0.0.0:80" admin_listener = "0.0.0.0:9000" admin_key = "secret" ssl_key_path = "" ssl_cert_path = "" piggyback_update_usage = true

debug_mode = false enable_pprof = false pprof_listener = "0.0.0.0:8730" reserved_origins = "s3.test.com,s3-internal.test.com"

Meta Config

meta_cache_type = 2 meta_store = "tidb" tidb_info = "root:@tcp(10.30.130.22:4000)/yig" keepalive = true enable_compression = false enable_usage_push = false redis_address = "127.0.0.1:6379" redis_password = "hehehehe" redis_connection_number = 10 memory_cache_max_entry_count = 100000 enable_data_cache = true redis_connect_timeout = 1 redis_read_timeout = 1 redis_write_timeout = 1 redis_keepalive = 60 redis_pool_max_idle = 3 redis_pool_idle_timeout = 30

cache_circuit_check_interval = 3 cache_circuit_close_sleep_window = 1 cache_circuit_close_required_count = 3 cache_circuit_open_threshold = 1 cache_circuit_exec_timeout = 5 cache_circuit_exec_max_concurrent = -1

db_max_open_conns = 10240 db_max_idle_conns = 1024 db_conn_max_life_seconds = 300

download_buf_pool_size = 8388608 #8MB upload_min_chunk_size = 524288 #512KB upload_max_chunk_size = 8388608 #8MB

Ceph Config

ceph_config_pattern = "/etc/ceph/*.conf"

Plugin Config

[plugins.dummy_compression] path = "/etc/yig/plugins/dummy_compression_plugin.so" enable = true

[plugins.encryption_vault] path = "/etc/yig/plugins/vault_plugin.so" enable = false [plugins.encryption_vault.args] endpoint = "http://10.30.130.22:8200" kms_id = "your_id" kms_secret = "your_secret" version = 0 keyName = "yig"

[plugins.encryption_kms] path = "/etc/yig/plugins/kms_plugin.so" enable = false [plugins.encryption_kms.args] url = "https://10.20.130.22:8011" keyName = "alias/yig" accessKey = "UYqO9JUqFFejWmO2" secretAccessKey = "0TsGg4snfyWMcn7KrfyeYKPZnLEm63" debug_mode = true token = "20cd173e-9d5a-431f-a26d-cdb1ad168c84"

[plugins.dummy_encryption_kms] path = "/etc/yig/plugins/dummy_kms_plugin.so" enable = true [plugins.dummy_encryption_kms.args] url = "KMS"

[plugins.dummy_mq] path = "/etc/yig/plugins/dummy_mq_plugin.so" enable = true [plugins.dummy_mq.args] topic = "testTopic2" url = "kafka:29092"

[plugins.dummy_iam]

path = "/etc/yig/plugins/dummy_iam_plugin.so"

enable = true

[plugins.dummy_iam.args]

url="s3.test.com"

[plugins.yig_iam] path = "/etc/yig/plugins/yig_iam_plugin.so" enable = true [plugins.yig_iam.args] EndPoint="http://127.0.0.1:8888/api/v1/yig/fetchsecretkey" ManageKey="key" ManageSecret="secret"

[plugins.not_exist] path = "not_exist_so" enable = false

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.57. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

baojunnj commented 3 years ago

s3访问的endpoint应置为域名,如果设置成ip则会出现类似问题