FriendsOfFlarum upload, the intelligent file attachment extension
- Edited
It stopped with this error:
In Manager.php line 85:
No adapter configured for aws_s3
- Edited
CyberGene I had this error in my first local test, to fix it I had to purge the extension, it must be something in the database and I couldn't find any other way, I think the problem arises if you already had an S3 adapter configured. Don't purge if you are in production.
I hope to be able to continue with the tests of this PR, that for now I have them stopped, with all this I tried to take the opportunity to check some things of the bucket and the CDN, and well, big mistake...
Darkle I’m working on a copy of my forum, not risking I’ll purge and reinstall the extension then.
- Edited
CyberGene in your local database try replacing upload_method
in the fof_upload_files
table from aws_s3
to aws-s3
. And see if it continues with that. So:
update fof_upload_files set upload_method = "aws-s3" where upload_method = "aws_s3";
Purging won't be a solution as we want to retain the files data in the database. Without it all references to uploaded files in posts will be lost.
Hey guys, very very very new and green to flarum.
Wanted to point out that this is still an issue making any non Amazon S3 compatible service i.e. R2, wasabi, B2 unusable for image storage as images cannot be rendered due to the URL hardcoding.
Is there a solution to this? I guess if not should be a warning that the extension doesn't really support S3 compatible storage for reads?
Maybe I missed an update.
I know you can set image size via pixel but it would be amazing to set a constraint of actual image size in megabytes or kilobytes and have it run a compression on the file.
Since I use. my site as a blog, I have to open each image in Photoshop and compress the image down to between 300kb-400kb which is what I aim for when uploading an image so I dont get hit too much on aws fees when people view the site. And it helps the page load faster for the user as well.
This would be awesome but maybe kill my server with multiple people compressing images at the same time...
Will there be a function at some point so that you can display unlinked pictures and delete them if necessary? This means that many images are uploaded and require an unnecessarily large amount of storage space without all of them being used. That would be really great
Hi, your extensions is not working well. I settings up the client id and is not working well. There a way to make FOF Upload working with imgur services?
wolfshards what exactly isn't working? Do you see any errors? If you're not providing details we cannot help you.
- Edited
Here my logs i got from FreeFlarum. I cannot access on a FTP to check some files but there all i got.
For resuming, I cannot upload some images in my post. But still active Client ID of Imgur.
[2022-07-14 16:14:54] flarum.ERROR: Intervention\Image\Exception\NotReadableException: Image source not readable in /app/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php:351
Stack trace:
#0 /app/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(66): Intervention\Image\AbstractDecoder->init()
#1 /app/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InsertCommand.php(23): Intervention\Image\AbstractDriver->init()
#2 /app/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(94): Intervention\Image\Gd\Commands\InsertCommand->execute()
#3 /app/vendor/intervention/image/src/Intervention/Image/Image.php(108): Intervention\Image\AbstractDriver->executeCommand()
#4 /app/vendor/fof/upload/src/Processors/ImageProcessor.php(102): Intervention\Image\Image->__call()
#5 /app/vendor/fof/upload/src/Processors/ImageProcessor.php(66): FoF\Upload\Processors\ImageProcessor->watermark()
#6 /app/vendor/fof/upload/src/Listeners/AddImageProcessor.php(33): FoF\Upload\Processors\ImageProcessor->process()
#7 /app/vendor/illuminate/events/Dispatcher.php(424): FoF\Upload\Listeners\AddImageProcessor->handle()
#8 /app/vendor/illuminate/events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events{closure}()
#9 /app/vendor/fof/upload/src/Commands/UploadHandler.php(151): Illuminate\Events\Dispatcher->dispatch()
#10 [internal function]: FoF\Upload\Commands\UploadHandler->FoF\Upload\Commands{closure}()
#11 /app/vendor/illuminate/collections/Collection.php(695): array_map()
#12 /app/vendor/fof/upload/src/Commands/UploadHandler.php(192): Illuminate\Support\Collection->map()
#13 /app/vendor/illuminate/bus/Dispatcher.php(122): FoF\Upload\Commands\UploadHandler->handle()
#14 /app/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}()
#15 /app/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#16 /app/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#17 /app/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow()
#18 /app/vendor/fof/upload/src/Api/Controllers/UploadController.php(52): Illuminate\Bus\Dispatcher->dispatch()
#19 /app/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(115): FoF\Upload\Api\Controllers\UploadController->data()
#20 /app/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractSerializeController->handle()
#21 /app/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http{closure}()
#22 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process()
#23 /app/vendor/kilowhat/flarum-ext-audit-free/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
#24 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
#25 /app/vendor/malago/flarum-achievements/src/Middlewares/MiddlewarePosted.php(27): Laminas\Stratigility\Next->handle()
#26 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Malago\Achievements\Middlewares\MiddlewarePosted->process()
#27 /app/vendor/nearata/flarum-ext-twofactor/src/Http/Middleware/AuthenticateWithTwoFactor.php(37): Laminas\Stratigility\Next->handle()
#28 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Nearata\TwoFactor\Http\Middleware\AuthenticateWithTwoFactor->process()
#29 /app/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
#30 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\ThrottleApi->process()
#31 /app/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
#32 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process()
#33 /app/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
#34 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process()
#35 /app/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
#36 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process()
#37 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
#38 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithHeader->process()
#39 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
#40 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process()
#41 /app/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#42 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process()
#43 /app/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#44 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process()
#45 /app/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
#46 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\FakeHttpMethods->process()
#47 /app/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#48 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process()
#49 /app/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#50 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process()
#51 /app/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
#52 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process()
#53 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
#54 /app/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#55 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process()
#56 /app/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
#57 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process()
#58 /app/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
#59 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process()
#60 /app/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#61 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process()
#62 /app/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#63 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process()
#64 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
#65 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process()
#66 /app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
#67 /app/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#68 /app/public/index.php(22): Flarum\Http\Server->listen()
#69 {main} !<
wolfshards are you able to try other storage drivers in FoF Upload to see if there's any difference?
That error looks like a FreeFlarum limit that would apply to any kind of image upload. Either it's not forwarding the file to the PHP process at all, or it's truncating the files to a given size limit.
Another lead could be something similar to what I fixed in Predefined Avatars where I had to rewind the image stream before reading. Apparently it fixed the issue for the users but I was never able to replicate the issue myself, so I'm not sure if it had something to do with another extension reading the file or something at the webserver level.
clarkwinkelmann it could also relate to gd missing or misconfigured, I'm not sure whether @SKevo has received similar reports about this?