AmpersandTarski / RAP

RAP is a tool that lets you analyse Ampersand models, generate functional specifications and make prototypes of information systems. It is the primary tool for students of the Open University of the Netherlands in the course Rule Based Design.
5 stars 3 forks source link

Runtime error: `Typed property Ampersand\Model::$compilerVersion must not be accessed before initialization` #310

Closed hanjoosten closed 1 year ago

hanjoosten commented 1 year ago

De situatie

I try to install RAP locally, using the instructions in the README of the RAP repo.

Wat er gebeurde er en wat had je verwacht?

I assume to get RAP up and running by exactly following the instructions. However at step 6. of the installation instructions for Docker, I get the runtime error. image

Stappen om dit te reproduceren

  1. Make sure you have no old volumes in your docker environment. (clean up stuff in Docker)
  2. Follow the installation instructions for Docker

Screenshot / Video

<-- click to open log. Error/Exception ~~~ Type: Error Message: Typed property Ampersand\Model::$compilerVersion must not be accessed before initialization File: /var/www/src/Ampersand/Plugs/MysqlDB/MysqlDB.php Line: 219 ~~~ Trace: ~~~ #0 /var/www/src/Ampersand/AmpersandApp.php(646): Ampersand\Plugs\MysqlDB\MysqlDB->addToModelVersionHistory(Object(Ampersand\Model)) #1 /var/www/src/Ampersand/AmpersandApp.php(588): Ampersand\AmpersandApp->registerCurrentModelVersion() #2 /var/www/public/api/v1/admin.installer.php(37): Ampersand\AmpersandApp->reinstall(true, false) #3 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Array) #4 /var/www/lib/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array) #5 /var/www/lib/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array) #6 /var/www/public/api/v1/index.php(198): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response)) #7 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route)) #8 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route)) #10 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route)) #11 /var/www/public/api/v1/admin.installer.php(114): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #12 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #13 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #14 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #15 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #16 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #17 /var/www/lib/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response)) #18 /var/www/lib/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response)) #19 /var/www/public/api/v1/index.php(166): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response)) #20 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) #21 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #22 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) #23 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) #24 /var/www/public/api/v1/index.php(220): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #25 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #26 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #27 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #28 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #29 /var/www/public/api/v1/index.php(280): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #30 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #31 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #32 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #33 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #34 /var/www/public/api/v1/index.php(320): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #35 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #36 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #37 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #38 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #39 /var/www/public/api/v1/index.php(344): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #40 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #41 /var/www/lib/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array) #42 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #43 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #44 /var/www/lib/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #45 /var/www/lib/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response)) #46 /var/www/lib/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response)) #47 /var/www/public/api/v1/index.php(345): Slim\App->run() #48 {main} ~~~

Context / Source van ampersand script

hanjoosten commented 1 year ago

@Michiel-s , Do you know what is going on here? I followed the instructions pretty carefully. Today I ran into this error again.

hanjoosten commented 1 year ago

Another observation: I returned a couple of minutes later to the page, and I clicked the Reinstall application button once more. Now the application was initialized successful. So I guess this is some timing issue.

Michiel-s commented 1 year ago

Hi @hanjoosten, this issue was know and reported in https://github.com/AmpersandTarski/prototype/issues/88 and solved in prototype framework v1.14.0

So I think it is time to update RAP to latest version asap. Main branch of RAP reports FROM ampersandtarski/prototype-framework:v1.12.0 in Dockerfile. Same applies to related image for student prototypes.

Michiel-s commented 1 year ago

Will be fixed after #295