Open luananama opened 2 years ago
Hey 👋 . It seems that the databases have not been created successfully.
Have you been able to run step 9 in the instructions
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set POOL_SIZE=18
And if so, what was the result?
Thanks!
that seems to work
Creating heroku-postgresql:hobby-dev on ⬢ moderator-backend... free
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
DEPRECATION NOTICE:
Starting November 28th, 2022, ‘hobby-dev’ databases will no longer be available. To retain your data after this date, upgrade to ‘mini’ or another paid plan.
Learn more in our blog (https://blog.heroku.com/new-low-cost-plans)
Created postgresql-sinuous-96552 as HEROKU_POSTGRESQL_GOLD_URL
Use heroku addons:docs heroku-postgresql to view documentation
Great. I should have also refered to step 13 yesterday (sorry, I was away from my computer when I replied):
Run heroku run "_build/prod/rel/magpie/bin/magpie eval 'Magpie.ReleaseTasks.db_migrate()'" (Note the ' in the command.)
Does this work?
And I guess you followed the instructions from this Github repo instead of on the documentation site (which might have been outdated), right?
Exactly, that also works
Hmm, what's the result then if you now try to access the app?
So now the UI shows up, I can manage my experiments, but when I create a new experiment, I get the message "Something went wrong" (experiments/1/edit
endpoint)
And when you say
the furthest I got on an attempt was managing to create an experiment, but getting an errror when editing it ("Something went wrong")
What is the log?
but when I create a new experiment, I get the message "Something went wrong" (experiments/1/edit endpoint)
What are the parameters you input for creating this experiment?
The active experiment box is checked, and then just the experiment name and author. I should add that if I go back to the experiments page, I can see that the experiment is created, but I can't edit it
I see there's an error at lib/magpie_web/views/experiment_view.ex:130: Magpie.ExperimentView.get_home_url/0
. So the app doesn't know the URL at which it's deployed. Have you run step 8:
Run heroku config:set HOST="[app_name].herokuapp.com" PORT=443 CANONNICAL_URL="https://[app_name].herokuapp.com" where [app_name] is the app name (shown when you first ran heroku create, e.g. mysterious-meadow-6277, or the app name that you set at the previous step, e.g. newname).
The app_name should be moderator-backend
here.
I see there's probably a typo in the instruction... Should be CANONICAL_URL instead of CANONNICAL_URL (double N). Could you try again with the single N?
oh wow haha that must have been the issue! It's typed correctly in the script, it was just a bit annoying to run it on windows, but next time I'll know! Thanks a lot :)
No worries! I just fixed the README. Sorry for the confusion! 🙏
Hey sorry to reopen this, but it seems there is still some issue with the deployed app, as I can't retrieve any results (getting an application error again).
I see. Unfortunately the logs don't seem to contain any information. Could you point me to the frontend you're running? I will test it against an instance I spin up.
Do you mean the repo or the netlify link?
The repo, so that I can edit the URL and point it to the instance I set up and try it out.
I was able to spin up a new app using the script at http://magpie-magpie-magpie.herokuapp.com/experiments (username and password: test
), submit the results and retrieve them correctly. Could you try with a simple experiment on both websites? If it still doesn't work, maybe something was disturbed during the retries to deploy the server. Could you try deleting the app and redeploying it again? Thanks!
Hello again, after several attempts to redeploy, in the end I managed to do it. Unfortunately I can't say what went wrong, but I suspect it had something to do with the cli I used (I tried both windows command prompt and git bash). The connection is somewhat unstable, for example I could submit the results if I ran my experiment locally, but not from the deployed version, until I restarted the dynos, and now I still sometimes get an Application error when I try to retrieve the results (even on the app you provided), but refreshing the page a couple of times seems to work.
Thanks a lot for your help!
After several attempts to deploy magpie backend with heroku, I am still getting an error. I followed the steps for manual deployment in the readme, and the furthest I got on an attempt was managing to create an experiment, but getting an errror when editing it ("Something went wrong")
On my last attempt I can't even access the app anymore. I'm posting the logs here, hopefully someone can figure out what's wrong :)
log
``` 2022-10-19T16:21:18.095928+00:00 app[web.1]: 16:21:18.095 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:21:18.095929+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:21:18.095930+00:00 app[web.1]: 2022-10-19T16:21:18.103318+00:00 app[web.1]: 16:21:18.103 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:21:18.103319+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:21:18.103319+00:00 app[web.1]: 2022-10-19T16:21:18.119684+00:00 app[web.1]: 16:21:18.117 [notice] Application magpie exited: Magpie.Application.start(:normal, []) returned an error: shutdown: failed to start child: Magpie.Experiments.ExperimentStatusResetWorker 2022-10-19T16:21:18.119698+00:00 app[web.1]: ** (EXIT) an exception was raised: 2022-10-19T16:21:18.119698+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table) relation "experiment_statuses" does not exist 2022-10-19T16:21:18.119699+00:00 app[web.1]: 2022-10-19T16:21:18.119702+00:00 app[web.1]: query: UPDATE "experiment_statuses" AS e0 SET "status" = $1 WHERE (e0."status" = 1) AND ((e0."last_heartbeat" IS NULL) OR (e0."last_heartbeat" < $2)) 2022-10-19T16:21:18.119702+00:00 app[web.1]: (ecto_sql 3.7.2) lib/ecto/adapters/sql.ex:760: Ecto.Adapters.SQL.raise_sql_call_error/1 2022-10-19T16:21:18.119703+00:00 app[web.1]: (ecto_sql 3.7.2) lib/ecto/adapters/sql.ex:693: Ecto.Adapters.SQL.execute/5 2022-10-19T16:21:18.119707+00:00 app[web.1]: (magpie 2.3.4) lib/magpie/experiments/experiment_status_reset_worker.ex:20: Magpie.Experiments.ExperimentStatusResetWorker.init/1 2022-10-19T16:21:18.119707+00:00 app[web.1]: (stdlib 3.17.1) gen_server.erl:423: :gen_server.init_it/2 2022-10-19T16:21:18.119708+00:00 app[web.1]: (stdlib 3.17.1) gen_server.erl:390: :gen_server.init_it/6 2022-10-19T16:21:18.119708+00:00 app[web.1]: (stdlib 3.17.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3 2022-10-19T16:21:19.660992+00:00 app[web.1]: {"Kernel pid terminated",application_controller,"{application_start_failure,magpie,{{shutdown,{failed_to_start_child,'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',{#{'__exception__' => true,'__struct__' => 'Elixir.Postgrex.Error',connection_id => 2343542,message => nil,postgres => #{code => undefined_table,file => <<\"parse_relation.c\">>,line => <<\"1381\">>,message => <<\"relation \\"experiment_statuses\\" does not exist\">>,pg_code => <<\"42P01\">>,position => <<\"8\">>,routine => <<\"parserOpenTable\">>,severity => <<\"ERROR\">>,unknown => <<\"ERROR\">>},query => <<\"UPDATE \\"experiment_statuses\\" AS e0 SET \\"status\\" = $1 WHERE (e0.\\"status\\" = 1) AND ((e0.\\"last_heartbeat\\" IS NULL) OR (e0.\\"last_heartbeat\\" < $2))\">>},[{'Elixir.Ecto.Adapters.SQL',raise_sql_call_error,1,[{file,\"lib/ecto/adapters/sql.ex\"},{line,760},{error_info,#{module => 'Elixir.Exception'}}]},{'Elixir.Ecto.Adapters.SQL',execute,5,[{file,\"lib/ecto/adapters/sql.ex\"},{line,693}]},{'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',init,1,[{file,\"lib/magpie/experiments/experiment_status_reset_worker.ex\"},{line,20}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,423}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,226}]}]}}},{'Elixir.Magpie.Application',start,[normal,[]]}}}"} 2022-10-19T16:21:19.666467+00:00 app[web.1]: Kernel pid terminated (application_controller) ({application_start_failure,magpie,{{shutdown,{failed_to_start_child,'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',{#{'__exception__' => true,'__struct__' => 'Elixir.Postgrex.Error',connection_id => 2343542,message => nil,postgres => #{code => undefined_table,file => <<"parse_relation.c">>,line => <<"1381">>,message => <<"relation \"experiment_statuses\" does not exist">>,pg_code => <<"42P01">>,position => <<"8">>,routine => <<"parserOpenTable">>,severity => <<"ERROR">>,unknown => <<"ERROR">>},query => <<"UPDATE \"experiment_statuses\" AS e0 SET \"status\" = $1 WHERE (e0.\"status\" = 1) AND ((e0.\"last_heartbeat\" IS NULL) OR (e0.\"last_heartbeat\" < $2))">>},[{'Elixir.Ecto.Adapters.SQL',raise_sql_call_error,1,[{file,"lib/ecto/adapters/sql.ex"},{line,760},{error_info,#{module => 'Elixir.Exception'}}]},{'Elixir.Ecto.Adapters.SQL',execute,5,[{file,"lib/ecto/adapters/sql.ex"},{line,693}]},{'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',init,1,[{f 2022-10-19T16:21:19.666600+00:00 app[web.1]: 2022-10-19T16:21:19.827109+00:00 app[web.1]: Crash dump is being written to: erl_crash.dump...done 2022-10-19T16:21:19.989731+00:00 heroku[web.1]: Process exited with status 1 2022-10-19T16:21:20.096866+00:00 heroku[web.1]: State changed from starting to crashed 2022-10-19T16:53:21.926149+00:00 heroku[web.1]: State changed from crashed to starting 2022-10-19T16:53:29.127642+00:00 heroku[web.1]: Starting process with command `_build/prod/rel/magpie/bin/magpie start` 2022-10-19T16:53:51.756944+00:00 app[web.1]: 16:53:51.756 [info] Running Magpie.Endpoint with cowboy 2.9.0 at 0.0.0.0:32327 (http) 2022-10-19T16:53:51.757905+00:00 app[web.1]: 16:53:51.757 [info] Access Magpie.Endpoint at https://moderator-backend.herokuapp.com:32327 2022-10-19T16:53:51.785730+00:00 app[web.1]: 16:53:51.781 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785731+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785731+00:00 app[web.1]: 2022-10-19T16:53:51.785732+00:00 app[web.1]: 16:53:51.780 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785732+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785732+00:00 app[web.1]: 2022-10-19T16:53:51.785732+00:00 app[web.1]: 16:53:51.781 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785733+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785733+00:00 app[web.1]: 2022-10-19T16:53:51.785734+00:00 app[web.1]: 16:53:51.781 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785734+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785734+00:00 app[web.1]: 2022-10-19T16:53:51.785734+00:00 app[web.1]: 16:53:51.782 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785735+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785735+00:00 app[web.1]: 2022-10-19T16:53:51.785735+00:00 app[web.1]: 16:53:51.782 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785735+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785735+00:00 app[web.1]: 2022-10-19T16:53:51.785736+00:00 app[web.1]: 16:53:51.782 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785736+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785736+00:00 app[web.1]: 2022-10-19T16:53:51.785736+00:00 app[web.1]: 16:53:51.783 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785736+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785736+00:00 app[web.1]: 2022-10-19T16:53:51.785737+00:00 app[web.1]: 16:53:51.783 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785737+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785737+00:00 app[web.1]: 2022-10-19T16:53:51.785737+00:00 app[web.1]: 16:53:51.784 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785737+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785738+00:00 app[web.1]: 2022-10-19T16:53:51.785738+00:00 app[web.1]: 16:53:51.784 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.785738+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.785738+00:00 app[web.1]: 2022-10-19T16:53:51.813604+00:00 app[web.1]: 16:53:51.784 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.813606+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.813606+00:00 app[web.1]: 2022-10-19T16:53:51.834139+00:00 app[web.1]: 16:53:51.780 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.834141+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.834141+00:00 app[web.1]: 2022-10-19T16:53:51.834142+00:00 app[web.1]: 16:53:51.787 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.834142+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.834142+00:00 app[web.1]: 2022-10-19T16:53:51.834142+00:00 app[web.1]: 16:53:51.787 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.834143+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.834143+00:00 app[web.1]: 2022-10-19T16:53:51.847159+00:00 app[web.1]: 16:53:51.813 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.847160+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.847161+00:00 app[web.1]: 2022-10-19T16:53:51.847161+00:00 app[web.1]: 16:53:51.816 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.847162+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.847162+00:00 app[web.1]: 2022-10-19T16:53:51.859377+00:00 app[web.1]: 16:53:51.844 [warning] Description: 'Authenticity is not established by certificate path validation' 2022-10-19T16:53:51.859378+00:00 app[web.1]: Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing' 2022-10-19T16:53:51.859379+00:00 app[web.1]: 2022-10-19T16:53:51.941318+00:00 app[web.1]: 16:53:51.940 [notice] Application magpie exited: Magpie.Application.start(:normal, []) returned an error: shutdown: failed to start child: Magpie.Experiments.ExperimentStatusResetWorker 2022-10-19T16:53:51.941319+00:00 app[web.1]: ** (EXIT) an exception was raised: 2022-10-19T16:53:51.941327+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table) relation "experiment_statuses" does not exist 2022-10-19T16:53:51.941327+00:00 app[web.1]: 2022-10-19T16:53:51.941327+00:00 app[web.1]: query: UPDATE "experiment_statuses" AS e0 SET "status" = $1 WHERE (e0."status" = 1) AND ((e0."last_heartbeat" IS NULL) OR (e0."last_heartbeat" < $2)) 2022-10-19T16:53:51.941328+00:00 app[web.1]: (ecto_sql 3.7.2) lib/ecto/adapters/sql.ex:760: Ecto.Adapters.SQL.raise_sql_call_error/1 2022-10-19T16:53:51.941328+00:00 app[web.1]: (ecto_sql 3.7.2) lib/ecto/adapters/sql.ex:693: Ecto.Adapters.SQL.execute/5 2022-10-19T16:53:51.941329+00:00 app[web.1]: (magpie 2.3.4) lib/magpie/experiments/experiment_status_reset_worker.ex:20: Magpie.Experiments.ExperimentStatusResetWorker.init/1 2022-10-19T16:53:51.941329+00:00 app[web.1]: (stdlib 3.17.1) gen_server.erl:423: :gen_server.init_it/2 2022-10-19T16:53:51.941329+00:00 app[web.1]: (stdlib 3.17.1) gen_server.erl:390: :gen_server.init_it/6 2022-10-19T16:53:51.941330+00:00 app[web.1]: (stdlib 3.17.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3 2022-10-19T16:53:53.599271+00:00 app[web.1]: {"Kernel pid terminated",application_controller,"{application_start_failure,magpie,{{shutdown,{failed_to_start_child,'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',{#{'__exception__' => true,'__struct__' => 'Elixir.Postgrex.Error',connection_id => 2357846,message => nil,postgres => #{code => undefined_table,file => <<\"parse_relation.c\">>,line => <<\"1381\">>,message => <<\"relation \\"experiment_statuses\\" does not exist\">>,pg_code => <<\"42P01\">>,position => <<\"8\">>,routine => <<\"parserOpenTable\">>,severity => <<\"ERROR\">>,unknown => <<\"ERROR\">>},query => <<\"UPDATE \\"experiment_statuses\\" AS e0 SET \\"status\\" = $1 WHERE (e0.\\"status\\" = 1) AND ((e0.\\"last_heartbeat\\" IS NULL) OR (e0.\\"last_heartbeat\\" < $2))\">>},[{'Elixir.Ecto.Adapters.SQL',raise_sql_call_error,1,[{file,\"lib/ecto/adapters/sql.ex\"},{line,760},{error_info,#{module => 'Elixir.Exception'}}]},{'Elixir.Ecto.Adapters.SQL',execute,5,[{file,\"lib/ecto/adapters/sql.ex\"},{line,693}]},{'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',init,1,[{file,\"lib/magpie/experiments/experiment_status_reset_worker.ex\"},{line,20}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,423}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,226}]}]}}},{'Elixir.Magpie.Application',start,[normal,[]]}}}"} 2022-10-19T16:53:53.630209+00:00 app[web.1]: Kernel pid terminated (application_controller) ({application_start_failure,magpie,{{shutdown,{failed_to_start_child,'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',{#{'__exception__' => true,'__struct__' => 'Elixir.Postgrex.Error',connection_id => 2357846,message => nil,postgres => #{code => undefined_table,file => <<"parse_relation.c">>,line => <<"1381">>,message => <<"relation \"experiment_statuses\" does not exist">>,pg_code => <<"42P01">>,position => <<"8">>,routine => <<"parserOpenTable">>,severity => <<"ERROR">>,unknown => <<"ERROR">>},query => <<"UPDATE \"experiment_statuses\" AS e0 SET \"status\" = $1 WHERE (e0.\"status\" = 1) AND ((e0.\"last_heartbeat\" IS NULL) OR (e0.\"last_heartbeat\" < $2))">>},[{'Elixir.Ecto.Adapters.SQL',raise_sql_call_error,1,[{file,"lib/ecto/adapters/sql.ex"},{line,760},{error_info,#{module => 'Elixir.Exception'}}]},{'Elixir.Ecto.Adapters.SQL',execute,5,[{file,"lib/ecto/adapters/sql.ex"},{line,693}]},{'Elixir.Magpie.Experiments.ExperimentStatusResetWorker',init,1,[{f 2022-10-19T16:53:53.630569+00:00 app[web.1]: 2022-10-19T16:53:53.820013+00:00 app[web.1]: Crash dump is being written to: erl_crash.dump...done 2022-10-19T16:53:54.019167+00:00 heroku[web.1]: Process exited with status 1 2022-10-19T16:53:54.146807+00:00 heroku[web.1]: State changed from starting to crashed 2022-10-19T17:07:25.876880+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=moderator-backend.herokuapp.com request_id=f43b2522-6e56-444f-9080-86202b11824e fwd="89.166.175.98" dyno= connect= service= status=503 bytes= protocol=https 2022-10-19T17:07:37.474367+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=moderator-backend.herokuapp.com request_id=b3e74cad-9628-40ed-b22c-cf15f275fcfc fwd="89.166.175.98" dyno= connect= service= status=503 bytes= protocol=https 2022-10-19T17:08:38.060204+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=moderator-backend.herokuapp.com request_id=e431d400-2ab4-468c-9c7d-eaed9e8e80ee fwd="89.166.175.98" dyno= connect= service= status=503 bytes= protocol=https 2022-10-19T17:13:17.553217+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=moderator-backend.herokuapp.com request_id=a7be2494-aa36-4fd0-a732-93ad024a0687 fwd="89.166.175.98" dyno= connect= service= status=503 bytes= protocol=https ```