Upload to Wasabi giving 500 Server Error since updating to latest Wappler

Wappler: 6.7.0
OS: MacOS M1
Server: PHP

I have a Server Connect library file which processes a file upload where it uploads the posted file to the server and then does a Put File to a Wasabi bucket. Once done it deletes the file from the server.

This has been working for a long time but I've just found out it stopped working a few weeks ago. I've established it's the Put File component which produces the 500 error and, fortunately because it breaks, the files have been left on the server so nothing is lost. However, I need to get this fixed.

The server log says this:

mydomain.com [Fri Jun 14 16:44:28 2024] [error] [client xx.xx.43.165:0] AH01071: Got error 'PHP message: PHP Fatal error: Cannot redeclare Aws\\constantly() (previously declared in /home/sites/my/vendor/aws/aws-sdk-php/src/functions.php:20) in /home/sites/my/dmxConnectLib/aws/Aws/functions.php on line 22'

The project was still on quite old Wappler scripts until a few weeks ago when I updated everything to the latest. I wasn't aware of this break until now, though.

I'm afraid I don't have much more info I can give. I've re-published everything so the server has all the files.

Any ideas how I can fix it?

Emergency fix is you go to project settings and disable Composer, and publish the site again

(I don't know if this works)

Thanks for the speedy reply. I got quite excited then but I'm afraid Composer is already disabled. :frowning:

Although composer is disabled, I can see the server error mentions the /vendor folder which is composer, isn't it? It must have been created some time ago and then I disabled composer but the files remained.

Should I delete that folder?

Topic caught my eye since I have a similar workflow, multi upload to server, convert and resize, put file(s) to Wasabi bucket, then delete from server.

I went ahead and updated to 6.7.0 and tested. Did not run into the same issue and image(s) uploaded fine. Just did the test in local development and not public test site or live site just in case it did fail.

Node server if that makes a difference.

Thanks @JonR. No, it's PHP but I'm thinking @Apple is onto something with composer.

Hopefully one of the Wappler team will be able to give some input.

Yes, you can delete that folder. If you then get a different error there might be a PHP composer file remaining somewhere (that tells to load everything inside vendor folder)

What happens if you enable, save settings, and disable again?

Thanks @Apple. I've removed the /vendor folder and also enabled, then disabled, composer and now I get this in the server error log:

mydomain.com [Fri Jun 14 18:51:49 2024] [error] [client xx.xx.43.165:0] AH01071: Got error 'PHP message: PHP Fatal error: During inheritance of Countable: Uncaught ErrorException: Return type of Aws\\HandlerList::count() should either be compatible with Countable::count(): int, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/sites/my/dmxConnectLib/aws/Aws/HandlerList.php:308\nStack trace:\n#0 /home/sites/my/dmxConnectLib/aws/Aws/HandlerList.php(32): exception_error_handler(8192, 'Return type of ...', '/home/sites/my/...', 308)\n#1 /home/sites/my/dmxConnectLib/aws/aws-autoloader.php(1463): require('/home/sites/my/...')\n#2 /home/sites/my/dmxConnectLib/aws/Aws/AwsClient.php(197): {closure}('Aws\\\\HandlerList')\n#3 /home/sites/my/dmxConnectLib/aws/Aws/S3/S3Client.php(328): Aws\\AwsClient->__construct(Array)\n#4 /home/sites/my/dmxConnectLib/modules/s3.php(32): Aws\\S3\\S3Client->__construct(Array)\n#5 /home/sites/my/dmxConnectLib/mod...'

I got exactly the same error after removing the vendor folder and before enabling/disabling composer in case that helps.

What PHP version are you using and can you switch to an recent version?

(that's just a random idea, I don't know if it makes a difference)

v8.1

I'll try a more recent one and see if that helps.

That's recent enough, forget it

How about you enable Composer?

P.S.: If that doesn't work, I don't have more ideas

v8.3 made no difference, as you expected.

I'll enable Composer.

Sadly enabling Composer and uploading the new /vendor folder makes no difference.

Thanks again for all your help. I'll wait for one of the Wappler team to respond.

@Teodor @George @patrick Help! Can you possibly assist me with this?

Huge thanks.

Bump... please :wink:

Bump again pleeeease.

Oh heck. I can't wait until September for this to be working again. Help!

1 Like

I just tested this and it works perfectly fine:

the file is uploaded to the server and then put in the wasabi bucket.
Probably you have some issues with old files or php packages.
Make sure Composer is enabled in your project settings and also update the PHP packages after enabling it.