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

File doesn't upload. Appears to be an issue with the saveMedia function #627

Closed
ericdstoltz opened this issue Jan 23, 2025 · 4 comments
Closed

Comments

@ericdstoltz
Copy link

System Info

  • PHP Version: 8.1.31
  • XBackBone Version: 3.8.0
  • Webserver: [Apache/Nginx/...] Apache2
  • Database backend: [SQLite/Mysql/...] <MariaDB/MySQL

Describe the bug
New Install. When uploading the upload stops at 100% but never completes. File does not show up in storage folder

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'upload and upload an image.

Expected behavior
Upload as designed

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
XBackBone and/or webserver logs.
[2025-01-23 13:03:24] app.ERROR: Slim Application Error
Type: ArgumentCountError
Code: 0
Message: Too few arguments to function App\Controllers\UploadController::saveMedia(), 3 passed in /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Controllers/UploadController.php on line 62 and exactly 4 expected
File: /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Controllers/UploadController.php
Line: 186
Trace: #0 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Controllers/UploadController.php(62): App\Controllers\UploadController->saveMedia()
#1 [internal function]: App\Controllers\UploadController->uploadWeb()
#2 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/php-di/invoker/src/Invoker.php(74): call_user_func_array()
#3 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/php-di/slim-bridge/src/ControllerInvoker.php(45): Invoker\Invoker->call()
#4 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/Routing/Route.php(384): DI\Bridge\Slim\ControllerInvoker->__invoke()
#5 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\Routing\Route->handle()
#6 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Middleware/CheckForMaintenanceMiddleware.php(26): Slim\MiddlewareDispatcher->handle()
#7 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(209): App\Middleware\CheckForMaintenanceMiddleware->__invoke()
#8 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Middleware/AuthMiddleware.php(33): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#9 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(209): App\Middleware\AuthMiddleware->__invoke()
#10 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#11 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/Routing/Route.php(341): Slim\MiddlewareDispatcher->handle()
#12 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/Routing/RouteRunner.php(84): Slim\Routing\Route->run()
#13 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Middleware/InjectMiddleware.php(21): Slim\Routing\RouteRunner->handle()
#14 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(209): App\Middleware\InjectMiddleware->__invoke()
#15 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Middleware/LangMiddleware.php(25): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#16 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(209): App\Middleware\LangMiddleware->__invoke()
#17 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/app/Middleware/RememberMiddleware.php(39): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#18 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(209): App\Middleware\RememberMiddleware->__invoke()
#19 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/bootstrap/app.php(105): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#20 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(313): Closure->{closure}()
#21 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(59): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#22 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\RoutingMiddleware->process()
#23 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#24 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\ErrorMiddleware->process()
#25 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Psr\Http\Server\RequestHandlerInterface@anonymous->handle()
#26 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/App.php(215): Slim\MiddlewareDispatcher->handle()
#27 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/vendor/slim/slim/Slim/App.php(199): Slim\App->handle()
#28 /mnt/primo-data/www/XXX.XXXXXXXXXX.XXX/html/xbackbone/index.php(11): Slim\App->run()
#29 {main}
Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor. [] []

@ericdstoltz
Copy link
Author

Fixed this issue by updating line 62 in UploadController.php to

$response = $this->saveMedia($response, $file, $user, param($request, 'code'));

Now having a different problem. Possibly Permissions. any ideas? www-data owns storage and has full permissions to it.

[2025-01-23 13:39:10] app.ERROR: Slim Application Error
Type: League\Flysystem\Exception
Code: 0
Message: Impossible to create the root directory "/mnt/primo-data/www/XXX.XXXXX.XXX/html/xbackbone/storage/Zehu4". mkdir(): Permission denied
File: /mnt/primo-data/www/XXX.XXXXX.XXX/html/xbackbone/vendor/league/flysystem/src/Adapter/Local.php
Line: 112

@SrS2225a
Copy link
Contributor

After applying your fix, I did not get any permission errors and uploading from the web portal now works as expected, including with ShareX. These are the permissions I set for xbackbone folder because I ran into similar permission issues with it before: drwxrwxrwx 10 root root 4.0K Jan 24 21:52 xbackbone

@The-MEO
Copy link
Contributor

The-MEO commented Jan 25, 2025

The Error message regarding ArgumentCountError should already be fixed with #625.
Maybee we can get a 3.8.1 version in the near future so that the automatic docker images are working again.

@sergix44
Copy link
Owner

Yes, 3.8.1 is on the way

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

4 participants