knowmics-lab / RNAdetector

RNAdetector: a free user-friendly and stand-alone software for RNA-Seq data analysis
https://rnadetector.atlas.dmi.unict.it/index.html
8 stars 8 forks source link

Missing .env file after cloud mode container restart results in authentication issues #56

Open sbstnk opened 1 year ago

sbstnk commented 1 year ago

In bootstrap.sh in the $CLOUD_ENV == true case /rnadetector/ws/.env is removed when the docker container is restarted. This is caused by these two lines:

  [ -f /rnadetector/ws/.env ] && mv /rnadetector/ws/.env /rnadetector/ws/.env.disabled
  [ -f /rnadetector/ws/.env.cloud ] && mv /rnadetector/ws/.env.cloud /rnadetector/ws/.env

When the container is started the first time, /rnadetector/ws/.env.cloud gets moved to /rnadetector/ws/.env. Then when the container gets restarted /rnadetector/ws/.env gets moved to /rnadetector/ws/.env.disabled, but there is no more /rnadetector/ws/.env.cloud to replace it by the time the second command is run in the second start of the container.

The lack of this file then leads to seemingly inexplicable authentication issues when creating new jobs:

Error: Call to undefined method Illuminate\Auth\TokenGuard::login() in /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:307
Stack trace:
#0 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Auth\AuthManager->__call()
#1 /rnadetector/ws/app/Jobs/Request.php(71): Illuminate\Support\Facades\Facade::__callStatic()
#2 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\Request->handle()
#3 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#5 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#6 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\Container\BoundMethod::call()
#7 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call()
#8 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#9 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#10 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then()
#11 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(83): Illuminate\Bus\Dispatcher->dispatchNow()
#12 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()
#13 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#14 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(85): Illuminate\Pipeline\Pipeline->then()
#15 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(59): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
#16 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(88): Illuminate\Queue\CallQueuedHandler->call()
#17 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(45): Illuminate\Queue\Jobs\Job->fire()
#18 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(182): Illuminate\Queue\SyncQueue->push()
#19 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(158): Illuminate\Bus\Dispatcher->pushCommandToQueue()
#20 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(73): Illuminate\Bus\Dispatcher->dispatchToQueue()
#21 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php(112): Illuminate\Bus\Dispatcher->dispatch()
#22 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(16): Illuminate\Foundation\Bus\PendingDispatch->__destruct()
#23 /rnadetector/ws/app/Http/Controllers/Api/JobController.php(210): App\Jobs\Request::dispatch()
#24 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Api\JobController->submit()
#25 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#26 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch()
#27 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#28 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()
#29 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#30 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authorize.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#31 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Auth\Middleware\Authorize->handle()
#32 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#33 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#34 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#35 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Auth\Middleware\Authenticate->handle()
#36 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#37 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then()
#38 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack()
#39 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute()
#40 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\Routing\Router->dispatchToRoute()
#41 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Routing\Router->dispatch()
#42 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#43 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#44 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#45 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#46 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#47 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#48 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#49 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#50 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#51 /rnadetector/ws/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#52 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle()
#53 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#54 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then()
#55 /rnadetector/ws/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#56 /rnadetector/ws/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle()
#57 {main}