Uploads via web UI fail, yet show up anyway.
MatthijsMarco opened this issue · 3 comments
Hello,
When I upload a song via the UI, it says "Upload failed: server error" for every single song. The songs do not show up in the UI. They do however show up in the uploads file. When I sync manually they do show up in the UI. Only thing unique to my setup is that I specified the path to the music to an external drive (to /media/internal1/music). Is there an issue on my end? Thanks!
[2022-03-16 21:17:44] production.ERROR: SQLSTATE[HY000] [14] unable to open database file {"userId":1,"exception":"[object] (PDOException(code: 14): SQLSTATE[HY000] [14] unable to open database file at /var/www/html/vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178)
[stacktrace]
#0 /var/www/html/vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php(178): PDO->__construct()
#1 /var/www/html/vendor/teamtnt/tntsearch/src/TNTSearch.php(68): TeamTNT\\TNTSearch\\Indexer\\TNTIndexer->createIndex()
#2 /var/www/html/vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php(321): TeamTNT\\TNTSearch\\TNTSearch->createIndex()
#3 /var/www/html/vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php(55): TeamTNT\\Scout\\Engines\\TNTSearchEngine->initIndex()
#4 /var/www/html/vendor/laravel/scout/src/Searchable.php(62): TeamTNT\\Scout\\Engines\\TNTSearchEngine->update()
#5 /var/www/html/vendor/laravel/scout/src/Searchable.php(41): App\\Models\\Artist->queueMakeSearchable()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php(124): Illuminate\\Database\\Eloquent\\Collection->Laravel\\Scout\\{closure}()
#7 /var/www/html/vendor/laravel/scout/src/Searchable.php(169): Illuminate\\Support\\Collection->__call()
#8 /var/www/html/vendor/laravel/scout/src/ModelObserver.php(109): App\\Models\\Song->searchable()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(424): Laravel\\Scout\\ModelObserver->saved()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php(189): Illuminate\\Events\\Dispatcher->dispatch()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1035): Illuminate\\Database\\Eloquent\\Model->fireModelEvent()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1006): Illuminate\\Database\\Eloquent\\Model->finishSave()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(509): Illuminate\\Database\\Eloquent\\Model->save()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(263): Illuminate\\Database\\Eloquent\\Builder->Illuminate\\Database\\Eloquent\\{closure}()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(510): tap()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\\Database\\Eloquent\\Builder->updateOrCreate()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2132): Illuminate\\Database\\Eloquent\\Model->forwardCallTo()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2144): Illuminate\\Database\\Eloquent\\Model->__call()
#20 /var/www/html/app/Services/FileSynchronizer.php(198): Illuminate\\Database\\Eloquent\\Model::__callStatic()
#21 /var/www/html/app/Services/UploadService.php(31): App\\Services\\FileSynchronizer->sync()
#22 /var/www/html/app/Http/Controllers/API/UploadController.php(25): App\\Services\\UploadService->handleUploadedFile()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\API\\UploadController->store()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#29 /var/www/html/app/Http/Middleware/Authenticate.php(28): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Authenticate->handle()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#43 /var/www/html/app/Http/Middleware/ForceHttps.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\ForceHttps->handle()
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#47 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#50 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#51 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#53 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#55 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then()
#57 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#58 /var/www/html/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle()
#59 {main}
koel:
image: hyzual/koel
depends_on:
- database
ports:
- 38060:80
environment:
- DB_CONNECTION=mysql
- DB_HOST=database
- DB_USERNAME=koel
- DB_PASSWORD=*KOEL_PASSWORD*
- DB_DATABASE=koel
volumes:
- music:/music
- covers:/var/www/html/public/img/covers
- search_index:/var/www/html/storage/search-indexes
database:
image: mysql/mysql-server:5.7
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=*ROOT_PASSWORD*
- MYSQL_DATABASE=koel
- MYSQL_USER=koel
- MYSQL_PASSWORD=*KOEL_PASSWORD*
volumes:
db:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/var/www/koel/mysql'
music:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/media/internal1/music/music'
covers:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/media/internal1/music/covers'
search_index:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/media/internal1/music/search_index'
Hi, from the stacktrace I would say it's a file permission problem. Does the www-data
user have write permission in the /var/www/html/storage/search-indexes
folder ?
The dockerfile normally creates that folder with the right permission so that a volume mounted there is_not_ created and owned by root.
Yep, that did the trick. Launched the bash of the docker and everything in /var/www/html/storage/search-indexes
was indeed owned by root. chown -R www-data:www-data /var/www/html/storage/search-indexes
fixed everything. I wonder what went wrong? Thanks for the help btw!
Cool :) maybe the first scan was made as user root, so it would have created all those files with root owner.