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

Error with s3 compatible storage and urlencode #66

Open
beathorst opened this issue Sep 21, 2023 · 0 comments
Open

Error with s3 compatible storage and urlencode #66

beathorst opened this issue Sep 21, 2023 · 0 comments

Comments

@beathorst
Copy link

beathorst commented Sep 21, 2023

In our setup (PHP 8.2, neos 8.3 and flownative/aws-s3 2.6.2) we get an error wen uploading a new image.
The problem ist that we do not use aws s3. The implementation of out s3 provider gets an error with urlencode

Error: test-neos-storage%2F47d092664c3c6f3fd583321a04442102be0cf14d
Has to be: test-neos-storage/47d092664c3c6f3fd583321a04442102be0cf14d

with this it would work, but I don't know if it breaks something else

return urlencode($storage->getBucketName()) . '/' . $storage->getKeyPrefix() . urlencode($resource->getSha1());

https://github.com/flownative/flow-aws-s3/blob/v2.6.2/Classes/S3Target.php#L378

23-09-20 09:48:07 127        ERROR                          ResourcePublishingMessage: Could not publish resource with SHA1 hash 47d092664c3c6f3fd583321a04442102be0cf14d (source object: test-neos-storage%2F47d092664c3c6f3fd583321a04442102be0cf14d) through "CopyObject" because the S3 client reported an error: Error executing "CopyObject" on "https://object.storage.eu01.onstackit.cloud/test-neos/47d092664c3c6f3fd583321a04442102be0cf14d/test-2.png"; AWS HTTP error: Client error: `PUT https://object.storage.eu01.onstackit.cloud/test-neos/47d092664c3c6f3fd583321a04442102be0cf14d/test-2.png` resulted in a `400 Bad Request` response:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidBucketName</Code><Message>The specified bucket is not valid.< (truncated...)
 InvalidBucketName (client): The specified bucket is not valid. - <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidBucketName</Code><Message>The specified bucket is not valid.</Message><Resource>/test-neos/47d092664c3c6f3fd583321a04442102be0cf14d/test-2.png</Resource><RequestId>1695203287484898</RequestId></Error>
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

1 participant