Get 401 error when trying to upload photos in Lychee 5.0.2 #2212
Replies: 11 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Good questions, no it's not in a directory structure, it's at the root. I tried |
Beta Was this translation helpful? Give feedback.
-
I was more referring to this: #2156 |
Beta Was this translation helpful? Give feedback.
-
Ah, brilliant! I did not see that, thank you. Let me try putting the right attributes on the ingress so this header is set and will close it if that works. |
Beta Was this translation helpful? Give feedback.
-
I tried the headers recommended on the other issue and it's not quite working yet. Here is some debugging output of the value of the headers on a request but the diagnostics page is still reporting an issue with the APP_URL and the image uploads are still failing. The values are redacted but otherwise accurate with what Lychee is seeing. { |
Beta Was this translation helpful? Give feedback.
-
i was having this same problem. i switched the linuxserver lychee image and it started working. |
Beta Was this translation helpful? Give feedback.
-
Do you know what the difference is from the official LycheeOrg image? Are there any issues migrating between them, or moving back if I run into problems with the linuxserver image? I will try it but just wanted to check first. Thanks for the recommendation 👍 |
Beta Was this translation helpful? Give feedback.
-
Same problem running the official docker image behind traefik. Fixed it by correctly setting the |
Beta Was this translation helpful? Give feedback.
-
I tried setting |
Beta Was this translation helpful? Give feedback.
-
if you are accessing your website from HTTPS, set APP_URL to your https url. However in your case, my guess is that you are not having the forwarding the https proto in your reverse proxy. In my apache reverse proxy I have:
There should be similar setting in yours. |
Beta Was this translation helpful? Give feedback.
-
I am experiencing the same issue putting the Lychee docker container behind Caddy reverse proxy, though the log for lychee simply shows the following:
Any help will be greatly appreciated. My APP_URL is set to my https URL and APP_FORCE_HTTPS is set to true, because if I set it to false it always makes requests over HTTP which Firefox blocks for obvious security reasons. Caddy automatically forwards all headers sent by the client, so none of them should need to be set manually, though I did try setting them manually and nothing changed. |
Beta Was this translation helpful? Give feedback.
-
Detailed description of the problem [REQUIRED]
I recently updated the docker image for Lychee and started seeing issues with the upload behavior. I have attempted to disable LiveWire but I don't think I've done so successfully. Some other notes are that I am running it in kubernetes and behind an nginx ingress, which did not have issues with 4.x but now seems to be preventing the file upload in the newest version.
Steps to reproduce the issue
Steps to reproduce the behavior:
Screenshots
Here is the stack trace from the response of /livewire/upload-file?expires=1704389775&signature=21fe80477a84a8229c51d2aad87203f2bd466394f88cbaa15616f8cf8d73b99b
{
"message": "",
"exception": "Symfony\Component\HttpKernel\Exception\HttpException",
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Application.php",
"line": 1248,
"trace": [
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php",
"line": 45,
"function": "abort",
"class": "Illuminate\Foundation\Application",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php",
"line": 86,
"function": "abort"
},
{
"file": "/var/www/html/Lychee/vendor/livewire/livewire/src/Features/SupportFileUploads/FileUploadController.php",
"line": 27,
"function": "abort_unless"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
"line": 46,
"function": "handle",
"class": "Livewire\Features\SupportFileUploads\FileUploadController",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 259,
"function": "dispatch",
"class": "Illuminate\Routing\ControllerDispatcher",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 205,
"function": "runController",
"class": "Illuminate\Routing\Route",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 806,
"function": "run",
"class": "Illuminate\Routing\Route",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 144,
"function": "Illuminate\Routing\{closure}",
"class": "Illuminate\Routing\Router",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/QueryStringFixer.php",
"line": 40,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\QueryStringFixer",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/DisableCSP.php",
"line": 55,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\DisableCSP",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
"line": 50,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Routing\Middleware\SubstituteBindings",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",
"line": 78,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/VerifyCsrfToken.php",
"line": 44,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\VerifyCsrfToken",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\VerifyCsrfToken",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php",
"line": 60,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Session\Middleware\AuthenticateSession",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
"line": 159,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
"line": 90,
"function": "handleRequest",
"class": "Illuminate\Routing\Middleware\ThrottleRequests",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Routing\Middleware\ThrottleRequests",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
"line": 49,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\View\Middleware\ShareErrorsFromSession",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 121,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 64,
"function": "handleStatefulRequest",
"class": "Illuminate\Session\Middleware\StartSession",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Session\Middleware\StartSession",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
"line": 37,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
"line": 67,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Cookie\Middleware\EncryptCookies",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/AcceptContentType.php",
"line": 50,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\AcceptContentType",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/AdminUserStatus.php",
"line": 55,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\AdminUserStatus",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/InstallationStatus.php",
"line": 55,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\InstallationStatus",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 119,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 805,
"function": "then",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 784,
"function": "runRouteWithinStack",
"class": "Illuminate\Routing\Router",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 748,
"function": "runRoute",
"class": "Illuminate\Routing\Router",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 737,
"function": "dispatchToRoute",
"class": "Illuminate\Routing\Router",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 200,
"function": "dispatch",
"class": "Illuminate\Routing\Router",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 144,
"function": "Illuminate\Foundation\Http\{closure}",
"class": "Illuminate\Foundation\Http\Kernel",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php",
"line": 19,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Livewire\Features\SupportDisablingBackButtonCache\DisableBackButtonCacheMiddleware",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/bepsvpt/secure-headers/src/SecureHeadersMiddleware.php",
"line": 20,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Bepsvpt\SecureHeaders\SecureHeadersMiddleware",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
"line": 31,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\TransformsRequest",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
"line": 40,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\TransformsRequest",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\TrimStrings",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\ValidatePostSize",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
"line": 99,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php",
"line": 39,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "Illuminate\Http\Middleware\TrustProxies",
"type": "->"
},
{
"file": "/var/www/html/Lychee/app/Http/Middleware/FixStatusCode.php",
"line": 30,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 183,
"function": "handle",
"class": "App\Http\Middleware\FixStatusCode",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 119,
"function": "Illuminate\Pipeline\{closure}",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 175,
"function": "then",
"class": "Illuminate\Pipeline\Pipeline",
"type": "->"
},
{
"file": "/var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 144,
"function": "sendRequestThroughRouter",
"class": "Illuminate\Foundation\Http\Kernel",
"type": "->"
},
{
"file": "/var/www/html/Lychee/public/index.php",
"line": 73,
"function": "handle",
"class": "Illuminate\Foundation\Http\Kernel",
"type": "->"
}
],
"previous_exception": null
}
If applicable, add screenshots to help explain your problem.
Output of the diagnostics [REQUIRED]
(Settings => Diagnostics or https://example.com/Diagnostics or
php artisan lychee:diagnostics
)Note on the diagnostics below, I suspect the APP_URL value I have is part of the issue but could not set it to anything that would resolve this error. If I set it to anything other than https://mydomain.com then none of the existing images load because it tries to do them with either http or a bad path.
Diagnostics
-----------
Warning: zend.assertions is disabled although Lychee is in debug mode. For easier debugging code generation for assertions should be enabled.
Error: APP_URL does not match the current url. This will break WebAuthn authentication.
Error: APP_URL does not match the current url. This will prevent images to be properly displayed.
Info: Latest version of PHP is 8.3
Warning: git (software) is not available.
Foreign key: access_permissions.user_id → users.id : CASCADE
Foreign key: albums.parent_id → albums.id : RESTRICT
Foreign key: albums.id → base_albums.id : RESTRICT
Foreign key: albums.cover_id → photos.id : CASCADE
Foreign key: base_albums.owner_id → users.id : RESTRICT
Foreign key: jobs_history.owner_id → users.id : RESTRICT
Foreign key: photos.album_id → albums.id : RESTRICT
Foreign key: photos.owner_id → users.id : RESTRICT
Foreign key: size_variants.photo_id → photos.id : RESTRICT
Foreign key: sym_links.size_variant_id → size_variants.id : RESTRICT
Foreign key: tag_albums.id → base_albums.id : RESTRICT
Browser and system
Brave/Chromium MacOS Sonoma 14.2.1
Beta Was this translation helpful? Give feedback.
All reactions