S3 Upload PHP 8.2 error

After getting the App Connect S3 Upload to work, it looks like I need to do it server-side so I can store various details about the file in my database but I just can’t find any documentation.

I’ve used the File Upload action to get the file uploaded to the hosting server. I then added the Put File action to copy that file to an S3 bucket but I get this error in the console and it fails:

"message": "Error executing \"PutObject\" on \"https:\/\/s3.eu-west-1.wasabisys.com\/MyTestBucket\/Test\/38.pdf\"; AWS HTTP error: Creation of dynamic property GuzzleHttp\\Handler\\CurlMultiHandler::$_mh is deprecated",

Here is my action:

What am I doing wrong?

Hey @sitestreet, does this give you what you need?

1 Like

Thanks @Antony. That has confirmed that I’m doing it the correct way. However, I’m still getting the error I pasted in the opening post.

@Teodor - are you able to check this for me? It’s a PHP site (php v8.2) and I’ve just tried it on a fresh project in case it’s to do with pre-beta AWS files but it’s giving the same error. I’m trying to upload to Wasabi.

"message": "Error executing \"PutObject\" on \"https:\/\/s3.eu-west-1.wasabisys.com\/MyTestBucket\/Test\/38.pdf\"; AWS HTTP error: Creation of dynamic property GuzzleHttp\\Handler\\CurlMultiHandler::$_mh is deprecated",

@sitestreet, this post seems to talk about the same issue…

Thanks @Antony. I’m not sure it’s the exact same issue. I’ve got it working if I set the policy to have full access. However, I need it to be write only access and when I have that set, the upload still works but the script then aborts with a permissions error. I need to know what permission is needed so I can create a custom policy which allows the bare minimum.

My post here explains and asks for help with that:

1 Like

Thanks for that @sitestreet!
I will be on the case of problems in the same S3 area in the next few days, and the PHP 8.1 versus 8.2 observation could make a big difference… thank you!

1 Like

I’m hoping @patrick can help and say what permissions are needed to complete the Put File process without allowing the API to access the actual files. I’m sure there is likely just one specific permission needed like GetBucketNotification but there are so many, it will take me ages to try them all one at a time.

OK, I’ve gone through all the different permissions and it looks like the Put File requires the GetObject permission as well as the PutObject.

Can someone (@Teodor, @patrick ?) confirm this? This is going to be a problem if that’s the case as I need to only grant Write access to the API key.

Did you try to update to the latest AWS sdk?

It is whatever Wappler installed when I created the SC script.

Any thoughts on the need for the GetObject permission?

Did you try using the PHP composer and letting it install the latest AWS sdk?

Yes, I did tests on a new project and composer installed loads of stuff and I uploaded it all to the server. I’m on the latest Wappler, too.

Hi there @sitestreet and @patrick

I am in the process of updating my Wappler from 3.9.7 to 5.8.2, and also upgrading my PHP from 7.3 to 8.X… and I need to choose wheither to go to PHP 8.1 or 8.2.

Can you both let me know if I’m likely to encounter an S3 upload problem with PHP 8.2 which I can avoid by installing PHP 8.1 instead?

Thanks!
Antony.

Hi @Antony. I believe v8.2 has the issue where v8.1 is OK. I don’t recall seeing a fix for this so I would say go to v8.1 for now and then switch to v8.2 when the fix is implemented.

1 Like

Thanks @sitestreet!

@patrick, do you have anything to add to this… like when there could be a fix that allows me to go to PHP 8.2?

I’m on a managed EC2 server, so I’m not quite sure if AWS will just automatically install 8.2 for me anyway! :flushed:

Confirming, i have seen a few issues with 8.2, stick with 8.1 for the moment

1 Like