Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[S3] S3Browser Upload file. NoSuchKey: The specified key does not exist. #2123

Closed
ldapomni opened this issue Jun 10, 2021 · 10 comments
Closed

Comments

@ldapomni
Copy link

Describe the bug
Cant upload a file with S3Browser (9.5.5).
Create bucket, list, delete - ok

Downloaded file with the content

<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID></ID></Owner><AccessControlList></AccessControlList></AccessControlPolicy>

Log error:

 s3api_handlers.go:89] status 404 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Resource>/btest/Y0010292.JPG</Resource><RequestId>1623348392685438000</RequestId></Error>

System Setup

Clear volumes.

  • 3 master
weed -v 1 master -defaultReplication=001 -mdir="h:\seaweedfs\mdata1" -ip="localhost" -port=9333 -peers=localhost:9333,localhost:9334,localhost:9335
weed -v 1 master -defaultReplication=001 -mdir="h:\seaweedfs\mdata2" -ip="localhost" -port=9334 -peers=localhost:9333,localhost:9334,localhost:9335
weed -v 1 master -defaultReplication=001 -mdir="h:\seaweedfs\mdata3" -ip="localhost" -port=9335 -peers=localhost:9333,localhost:9334,localhost:9335
  • 3 volume
weed -v 1 volume -port=8081 -dir="h:\seaweedfs\data1" -mserver="localhost:9333,localhost:9334,localhost:9335" -dataCenter=vc1 -rack=rack1
weed -v 1 volume -port=8082 -dir="h:\seaweedfs\data2" -mserver="localhost:9333,localhost:9334,localhost:9335" -dataCenter=vc1 -rack=rack1
weed -v 1 volume -port=8083 -dir="h:\seaweedfs\data3" -mserver="localhost:9333,localhost:9334,localhost:9335" -dataCenter=vc1 -rack=rack1
  • Filer, S3
    weed -v 4 filer -s3

  • OS version Windows 10, CentOS 7 some result

  • version 30GB 2.52 76f24af windows amd64

  • default filer.toml

  • S3Browser config - S3 Compatible Storage, REST Endpoint: localhost:8333, path style, signature V4

  • full log

I0610 22:17:18  7512 filer_grpc_server.go:49] ListEntries directory:"/buckets/btest"  limit:10001
I0610 22:17:18  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 1024
I0610 22:17:18  7512 filer_client.go:166] exists entry /buckets/btest: directory:"/buckets"  name:"btest"
I0610 22:17:18  7512 filer_grpc_server.go:22] LookupDirectoryEntry \buckets\btest
I0610 22:17:18  7512 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>btest</Name><Prefix></Prefix><Marker></Marker><MaxKeys>10000</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>
I0610 22:17:18  7512 s3api_object_handlers.go:294] s3 proxying GET to http://192.168.31.140:8888/buckets/btest/Y0010286.JPG
I0610 22:17:18  7512 filer_server_handlers_read.go:39] Not found /buckets/btest/Y0010286.JPG: filer: no entry is found in filer store
I0610 22:17:18  7512 s3api_handlers.go:89] status 404 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Resource>/btest/Y0010286.JPG</Resource><RequestId>1623349038037703000</RequestId></Error>
I0610 22:17:19  7512 filer_server_handlers_write_upload.go:57] received byte buffer 1
I0610 22:17:19  7512 filer_server_handlers_write_upload.go:101] uploaded Y0010286.JPG chunk 1 to 3,0e20afbca1 [0,3319119)
I0610 22:17:19  7512 filer_server_handlers_write_autochunk.go:182] saving /buckets/btest/Y0010286.JPG
I0610 22:17:19  7512 filer.go:191] find uncached directory: /buckets/btest
I0610 22:17:19  7512 filer.go:154] InsertEntry /buckets/btest/Y0010286.JPG: new entry: Y0010286.JPG
I0610 22:17:19  7512 filerstore_wrapper.go:119] InsertEntry /buckets/btest/Y0010286.JPG
I0610 22:17:19  7512 filer.go:176] CreateEntry /buckets/btest/Y0010286.JPG: created
I0610 22:17:19  7512 s3api_object_handlers.go:294] s3 proxying GET to http://192.168.31.140:8888/buckets/btest/Y0010286.JPG
I0610 22:17:20  7512 s3api_object_handlers.go:294] s3 proxying GET to http://192.168.31.140:8888/buckets/btest/Y0010286.JPG
I0610 22:17:21  7512 filer_server_handlers_write_upload.go:57] received byte buffer 1
I0610 22:17:21  7512 filer_server_handlers_write_upload.go:101] uploaded Y0010286.JPG chunk 1 to 5,0f5af5536f [0,154)
I0610 22:17:21  7512 filer_server_handlers_write_autochunk.go:182] saving /buckets/btest/Y0010286.JPG
I0610 22:17:21  7512 filer.go:164] UpdateEntry /buckets/btest/Y0010286.JPG: old entry: Y0010286.JPG
I0610 22:17:21  7512 filerstore_wrapper.go:140] UpdateEntry /buckets/btest/Y0010286.JPG
I0610 22:17:21  7512 filer.go:176] CreateEntry /buckets/btest/Y0010286.JPG: created
I0610 22:17:21  7512 filer_grpc_server.go:49] ListEntries directory:"/buckets/btest"  limit:1001
I0610 22:17:21  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 1001
I0610 22:17:21  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from Y0010286.JPG prefix  limit 1001
I0610 22:17:21  7512 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>btest</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><Delimiter>/</Delimiter><IsTruncated>false</IsTruncated><Contents><Key>Y0010286.JPG</Key><ETag>&#34;888ba5d27c0e00cacdaf9f42192b1ec9&#34;</ETag><Size>154</Size><Owner><ID>ffffffff</ID></Owner><StorageClass>STANDARD</StorageClass><LastModified>2021-06-10T18:17:21Z</LastModified></Contents></ListBucketResult>
I0610 22:17:21  7512 filer_deletion.go:60] deleting fileIds len=1
I0610 22:17:23  7512 filer.go:191] find uncached directory: /topics/.system/log/2021-06-10
I0610 22:17:23  7512 filer.go:154] InsertEntry /topics/.system/log/2021-06-10/18-16.segment: new entry: 18-16.segment
I0610 22:17:23  7512 filerstore_wrapper.go:119] InsertEntry /topics/.system/log/2021-06-10/18-16.segment
I0610 22:17:23  7512 filer.go:176] CreateEntry /topics/.system/log/2021-06-10/18-16.segment: created

Upload with Filer and also download with S3Browser - ok,


I0610 22:19:43  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries / from  prefix  limit 101
I0610 22:19:43  7512 filer_server_handlers_read_dir.go:56] listDirectory , last file topics, limit 100: 2 items
I0610 22:19:46  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets from  prefix  limit 101
I0610 22:19:46  7512 filer_server_handlers_read_dir.go:56] listDirectory /buckets, last file btest, limit 100: 1 items
I0610 22:19:47  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 101
I0610 22:19:47  7512 filer_server_handlers_read_dir.go:56] listDirectory /buckets/btest, last file Y0010286.JPG, limit 100: 1 items
I0610 22:19:55  7512 filer_server_handlers_write_upload.go:57] received byte buffer 1
I0610 22:19:55  7512 filer_server_handlers_write_upload.go:101] uploaded IMG_1198.JPG chunk 1 to 2,115c67437a [0,777233)
I0610 22:19:55  7512 filer_server_handlers_write_autochunk.go:182] saving /buckets/btest/IMG_1198.JPG
I0610 22:19:55  7512 filer.go:191] find uncached directory: /buckets/btest
I0610 22:19:55  7512 filer.go:154] InsertEntry /buckets/btest/IMG_1198.JPG: new entry: IMG_1198.JPG
I0610 22:19:55  7512 filerstore_wrapper.go:119] InsertEntry /buckets/btest/IMG_1198.JPG
I0610 22:19:55  7512 filer.go:176] CreateEntry /buckets/btest/IMG_1198.JPG: created
I0610 22:19:56  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 101
I0610 22:19:56  7512 filer_server_handlers_read_dir.go:56] listDirectory /buckets/btest, last file Y0010286.JPG, limit 100: 2 items

I0610 22:19:43  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries / from  prefix  limit 101
I0610 22:19:43  7512 filer_server_handlers_read_dir.go:56] listDirectory , last file topics, limit 100: 2 items
I0610 22:19:46  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets from  prefix  limit 101
I0610 22:19:46  7512 filer_server_handlers_read_dir.go:56] listDirectory /buckets, last file btest, limit 100: 1 items
I0610 22:19:47  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 101
I0610 22:19:47  7512 filer_server_handlers_read_dir.go:56] listDirectory /buckets/btest, last file Y0010286.JPG, limit 100: 1 items
I0610 22:19:55  7512 filer_server_handlers_write_upload.go:57] received byte buffer 1
I0610 22:19:55  7512 filer_server_handlers_write_upload.go:101] uploaded IMG_1198.JPG chunk 1 to 2,115c67437a [0,777233)
I0610 22:19:55  7512 filer_server_handlers_write_autochunk.go:182] saving /buckets/btest/IMG_1198.JPG
I0610 22:19:55  7512 filer.go:191] find uncached directory: /buckets/btest
I0610 22:19:55  7512 filer.go:154] InsertEntry /buckets/btest/IMG_1198.JPG: new entry: IMG_1198.JPG
I0610 22:19:55  7512 filerstore_wrapper.go:119] InsertEntry /buckets/btest/IMG_1198.JPG
I0610 22:19:55  7512 filer.go:176] CreateEntry /buckets/btest/IMG_1198.JPG: created
I0610 22:19:56  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 101
I0610 22:19:56  7512 filer_server_handlers_read_dir.go:56] listDirectory /buckets/btest, last file Y0010286.JPG, limit 100: 2 items
I0610 22:20:23  7512 filer.go:191] find uncached directory: /topics/.system/log/2021-06-10
I0610 22:20:23  7512 filer.go:154] InsertEntry /topics/.system/log/2021-06-10/18-19.segment: new entry: 18-19.segment
I0610 22:20:23  7512 filerstore_wrapper.go:119] InsertEntry /topics/.system/log/2021-06-10/18-19.segment
I0610 22:20:23  7512 filer.go:176] CreateEntry /topics/.system/log/2021-06-10/18-19.segment: created
I0610 22:22:01  7512 filer_grpc_server.go:49] ListEntries directory:"/buckets/btest"  limit:1001
I0610 22:22:01  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from  prefix  limit 1001
I0610 22:22:01  7512 filerstore_wrapper.go:243] ListDirectoryPrefixedEntries /buckets/btest from Y0010286.JPG prefix  limit 1001
I0610 22:22:01  7512 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>btest</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><Delimiter>/</Delimiter><IsTruncated>false</IsTruncated><Contents><Key>IMG_1198.JPG</Key><ETag>&#34;9075734cf8369ab9c13265974fefccdf&#34;</ETag><Size>777233</Size><Owner><ID>ffffffff</ID></Owner><StorageClass>STANDARD</StorageClass><LastModified>2021-06-10T18:19:55Z</LastModified></Contents><Contents><Key>Y0010286.JPG</Key><ETag>&#34;888ba5d27c0e00cacdaf9f42192b1ec9&#34;</ETag><Size>154</Size><Owner><ID>ffffffff</ID></Owner><StorageClass>STANDARD</StorageClass><LastModified>2021-06-10T18:17:21Z</LastModified></Contents></ListBucketResult>
I0610 22:22:16  7512 s3api_object_handlers.go:294] s3 proxying HEAD to http://192.168.31.140:8888/buckets/btest/IMG_1198.JPG
I0610 22:22:16  7512 s3api_object_handlers.go:294] s3 proxying GET to http://192.168.31.140:8888/buckets/btest/IMG_1198.JPG
  • S3Browser Log:
[I] [2021-06-10 22:17:18] Reading permissions for btest/Y0010286.JPG TaskID: 721
[I] [2021-06-10 22:17:18] NoSuchKey: The specified key does not exist. TaskID: 721

@ldapomni
Copy link
Author

Found, Not work with S3Browser options - Multipart upload enable. If disable - work fine,

@chrislusf
Copy link
Collaborator

Have you configured access key and security key? weed filer -s3.config=... or via weed shell -> s3.configure

@ldapomni
Copy link
Author

Test with -s3.config=s3config.json and empty auth

{
  "identities": [
    {
      "name": "test",
      "credentials": [
        {
          "accessKey": "test1",
          "secretKey": "test1"
        }
      ],
      "actions": [
        "Admin",
        "Read",
        "List",
        "Tagging",
        "Write"
      ]
    }
  ]
}

@ldapomni
Copy link
Author

I made a mistake, the option "inherit premissions from the parent bucket" is affected, not "multipart upload"

@ldapomni
Copy link
Author

ldapomni commented Jun 10, 2021

Test with minio (no problem)

Reading permissions for ... return:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>Y0010728.JPG</Key><BucketName>new-bucket-00c91226</BucketName><Resource>/new-bucket-00c91226/Y0010728.JPG</Resource><RequestId>168755B60092355C</RequestId><HostId>afc5fbb8-d4e8-4572-97fa-f1eabfe69b56</HostId></Error>

Seaweedfs:


<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Resource>/new-bucket-cce62012/Y0260007.JPG</Resource><RequestId>1623359751244162200</RequestId></Error>

diff: Key, BucketName

it looks like s3browser reads the fields key or/and bucketname

@ldapomni
Copy link
Author

Similar error when creating a subdirectory

create subdir Nextcloud, get error:


I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 filer_client.go:166] exists entry /buckets/test: directory:"/buckets" name:"test"
I0611 09:55:45 28221 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>test</Name><Prefix></Prefix><Marker></Marker><MaxKeys>10000</MaxKeys><Delimiter>/</Delimiter><IsTruncated>false</IsTruncated></ListBucketResult>
I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 s3api_object_handlers.go:294] s3 proxying HEAD to http://localhost:8888/buckets/test/New%20Folder
I0611 09:55:45 28221 s3api_handlers.go:89] status 404 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Resource>/test/New Folder</Resource><RequestId>1623390945178717026</RequestId></Error>
I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 filer_client.go:166] exists entry /buckets/test: directory:"/buckets" name:"test"
I0611 09:55:45 28221 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>test</Name><Prefix>New Folder/</Prefix><Marker></Marker><MaxKeys>1</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>

create subdir with s3browser, get error:


I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 s3api_object_handlers.go:294] s3 proxying HEAD to http://localhost:8888/buckets/test/New%20Folder
I0611 09:55:45 28221 s3api_handlers.go:89] status 404 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Resource>/test/New Folder</Resource><RequestId>1623390945333034947</RequestId></Error>
I0611 09:55:45 28221 auth_credentials.go:172] v4 auth type
I0611 09:55:45 28221 auth_credentials.go:193] user name: admin actions: [Admin Read List Tagging Write]
I0611 09:55:45 28221 filer_client.go:166] exists entry /buckets/test: directory:"/buckets" name:"test"
I0611 09:55:45 28221 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>test</Name><Prefix>New Folder/</Prefix><Marker></Marker><MaxKeys>1</MaxKeys><IsTruncated>false</IsTruncated></ListBucketR


@chrislusf
Copy link
Collaborator

was this tested with the fix? Get it here: https://github.com/chrislusf/seaweedfs/releases/dev

@ldapomni
Copy link
Author

ldapomni commented Jun 11, 2021

it didn't help for s3browser, nextcloud

but mc (from minio) I didn't work before that either
mc cp test.txt seaweed/test/subtest/
it worked

@chrislusf
Copy link
Collaborator

for windows, you need to run weed s3 -allowEmptyFolder, or weed filer -s3.allowEmptyFolder

@ldapomni
Copy link
Author

Thanks! it work! And work in linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants