9 Mar 2024 |
Mayel | Yes, generated from same markdown :) | 20:07:22 |
Jeff | I like the search on the pinned version :) | 20:07:53 |
Mayel | Yep, that one uses ex_doc, elixir’s built-in documentation tooling | 20:08:25 |
Jeff | No luck. I'm writing up my process and will share it here once I scrub out any personal info. I'll probably go through the process a few more times, too, while I write things up to see if I missed a step or something. Appreciate your help today. | 22:26:22 |
Mayel | Great, appreciate it | 22:48:23 |
Mayel | * Great, appreciate your patience! | 22:48:41 |
10 Mar 2024 |
Jeff | Alright - my notes (very long, I document everything lol) but the summary is this: when I get to just rel-run, it's attempting to pull the docker images and build the containers from the composer files, but it's failing before they get created. Not even the images get pulled down at this point. This is the result from just rel-run
MIX_ENV=prod just pre-init
Using prod env, with flavour: classic at path: flavours/classic
Error response from daemon: No such container: bonfire_web
Error response from daemon: No such container: bonfire_web
just rel-services $services
error: Justfile does not contain recipe proxy.
error: Recipe `rel-run` failed on line 690 with exit code 1
| 05:25:02 |
Mayel | In reply to @box464:matrix.org
Alright - my notes (very long, I document everything lol) but the summary is this: when I get to just rel-run, it's attempting to pull the docker images and build the containers from the composer files, but it's failing before they get created. Not even the images get pulled down at this point. This is the result from just rel-run
MIX_ENV=prod just pre-init
Using prod env, with flavour: classic at path: flavours/classic
Error response from daemon: No such container: bonfire_web
Error response from daemon: No such container: bonfire_web
just rel-services $services
error: Justfile does not contain recipe proxy.
error: Recipe `rel-run` failed on line 690 with exit code 1
- Yes, wildcard DNS is only needed for CoopCloud, but note that you can have wildcard on a subdomain eg. *.selfhosting.mydomain.net - If Nginx will be providing SSL, you probably want to change your .env to have PUBLIC_PORT=443 (this is the port that users will use to access the app) and SERVER_PORT=4343 (this is the port that the nginx proxy will use to access the app locally) - Since you don’t need the caddy proxy, you should run `just rel-run db` which will run just the DB as a background service + the bonfire app and skip caddy - Given the current error relates to the proxy, can you let us know what result you get with this instead? | 09:57:58 |
Mayel | Thanks for the writeup, that’s really useful and in fact can be used to improve our docs :) | 09:58:30 |
Mayel | In reply to @box464:matrix.org
Alright - my notes (very long, I document everything lol) but the summary is this: when I get to just rel-run, it's attempting to pull the docker images and build the containers from the composer files, but it's failing before they get created. Not even the images get pulled down at this point. This is the result from just rel-run
MIX_ENV=prod just pre-init
Using prod env, with flavour: classic at path: flavours/classic
Error response from daemon: No such container: bonfire_web
Error response from daemon: No such container: bonfire_web
just rel-services $services
error: Justfile does not contain recipe proxy.
error: Recipe `rel-run` failed on line 690 with exit code 1
* - Yes, wildcard DNS is only needed for CoopCloud, but note that you can have wildcard on a subdomain eg. *.selfhosting.mydomain.net - If your own Nginx will act as proxy and be providing SSL, you probably want to change your .env to have PUBLIC_PORT=443 (this is the port that users will use to access the app) and SERVER_PORT=4343 (this is the port that the nginx proxy will use to access the app locally) - Since you don’t need the caddy proxy, you should run `just rel-run db` which will run just the DB as a background service + the bonfire app and skip caddy - Given the current error relates to the proxy, can you let us know what result you get with this instead? | 09:58:57 |
Mayel | In reply to @box464:matrix.org
Alright - my notes (very long, I document everything lol) but the summary is this: when I get to just rel-run, it's attempting to pull the docker images and build the containers from the composer files, but it's failing before they get created. Not even the images get pulled down at this point. This is the result from just rel-run
MIX_ENV=prod just pre-init
Using prod env, with flavour: classic at path: flavours/classic
Error response from daemon: No such container: bonfire_web
Error response from daemon: No such container: bonfire_web
just rel-services $services
error: Justfile does not contain recipe proxy.
error: Recipe `rel-run` failed on line 690 with exit code 1
* - Yes, wildcard DNS is only needed for CoopCloud, but note that you can have wildcard on a subdomain eg. `*.selfhosting.mydomain.net` - If your own Nginx will act as proxy and be providing SSL, you probably want to change your .env to have PUBLIC_PORT=443 (this is the port that users will use to access the app) and SERVER_PORT=4343 (this is the port that the nginx proxy will use to access the app locally) - Since you don’t need the caddy proxy, you should run `just rel-run db` which will run just the DB as a background service + the bonfire app and skip caddy - Given the current error relates to the proxy, can you let us know what result you get with this instead? | 10:06:19 |
Jeff | Oooh! Thanks for finding that mis-step. Changing the ports and using the db parameter got me farther along. Container created, the just rel-run db command executed.
I see the following warnings/error in the elixir stream after running that statement, but before doing anything else:
14:18:01.733 [error] Could not find static manifest at "/opt/app/lib/bonfire-0.1.0-beta.3/priv/static/cache_manifest.json". Run "mix phx.digest" after building your static files or remove the "cache_static_manifest" configuration from your config files.
14:18:01.737 [warning] The oban_peers table is undefined and leadership is disabled.
Run migrations up to v11 to restore peer leadership. In the meantime, distributed plugins (e.g. Cron, Pruner, Stager) will not run on any nodes.
| 14:25:34 |
Jeff | I ignored those and attempted to run the next commands.
bin/bonfire remote
** (CompileError) iex:1: undefined function bin/0 (there is no such import)
iex(bonfire@a7ebe1db46a2)1> Bonfire.Common.Repo.migrate
** (UndefinedFunctionError) function Bonfire.Common.Repo.migrate/0 is undefined or private (bonfire_common 0.1.0) Bonfire.Common.Repo.migrate() iex(bonfire@a7ebe1db46a2)1> 14:19:56.959 [warning] The oban_peers table is undefined and leadership is disabled.
| 14:27:07 |
Jeff | Later, I'll try a fresh install with these new settings (I tried this above from where I left off last night) | 14:35:46 |
Mayel | In reply to @box464:matrix.org Later, I'll try a fresh install with these new settings (I tried this above from where I left off last night) Oh I think it may be using a quite outdated docker image (since it defaults to a multi arch image but CI hasn’t been building those for a while) could you try adding one of these to your .env? # for ARM: APP_DOCKER_IMAGE=bonfirenetworks/bonfire:latest-classic-aarch64 # for x86: APP_DOCKER_IMAGE=bonfirenetworks/bonfire:latest-classic-amd64 | 15:22:42 |
Jeff | ![image.png](https://matrix.org/_matrix/media/r0/thumbnail/matrix.org/yJbLgkDFPQHoVmYldxQrpqMg?height=360&method=scale&width=360) Download image.png | 16:13:05 |
Jeff | Getting closer!
Looking at the stream of logs now. | 16:13:25 |
Jeff | Next steps in the doc where to run these commands at the prompt:
bin/bonfire remote Bonfire.Common.Repo.migrate
At this point, in the terminal I'm seeing logs fly by very quickly, but I can start typing and a prompt appears for me to enter commands. I get errors on both, but I feel like I'm already in the iex environment so that's not needed?
iex(bonfire@e6db3952666c)1> bin/bonfire remote
error: undefined variable "bin"
└─ iex:1
** (CompileError) cannot compile code (errors have been logged)
iex(bonfire@d60102fd054a)1> Bonfire.Common.Repo.migrate
16:26:27.471 [info] Child {Postgrex.Protocol, #PID<0.7914.0>, 1} of Supervisor #PID<0.7915.0> (DBConnection.ConnectionPool.Pool) started
Pid: #PID<0.7916.0>
Start Call: DBConnection.Connection.start_link(Postgrex.Protocol, [pool_index: 1, max_restarts: 0, backoff_type: :stop, database: "postgres", telemetry_prefix: [:bonfire, :common, :repo], otp_app: :bonfire_umbrella, types: Bonfire.Geolocate.PostgresTypes, username: "postgres", password: "1af6-4c9d-b518-f10e6c96f518-42665e9d-23b8", hostname: "db", socket_options: [], priv: "priv/repo", slow_query_ms: 100, connect_timeout: 10000, timeout: 20000, parameters: [statement_timeout: "20000", idle_in_transaction_session_timeout: "5000"]], #PID<0.7914.0>, #Reference<0.1782843226.320995329.1398>)
16:26:27.474 [info] Migrate Bonfire.Common.Repo
16:26:27.476 [info] Migrations already up
Migration path: "/opt/app/lib/bonfire_umbrella-0.9.10-classic-beta.2/priv/repo"
Repo: Bonfire.Common.Repo
Status Migration ID Migration Name
--------------------------------------------------
[:ok]
16:26:29.140 [error] GenServer {Oban.Registry, {Oban, {:producer, "federator_incoming"}}} terminating
| 16:34:35 |
Jeff | In reply to @box464:matrix.org
Next steps in the doc where to run these commands at the prompt:
bin/bonfire remote Bonfire.Common.Repo.migrate
At this point, in the terminal I'm seeing logs fly by very quickly, but I can start typing and a prompt appears for me to enter commands. I get errors on both, but I feel like I'm already in the iex environment so that's not needed?
iex(bonfire@e6db3952666c)1> bin/bonfire remote
error: undefined variable "bin"
└─ iex:1
** (CompileError) cannot compile code (errors have been logged)
iex(bonfire@d60102fd054a)1> Bonfire.Common.Repo.migrate
16:26:27.471 [info] Child {Postgrex.Protocol, #PID<0.7914.0>, 1} of Supervisor #PID<0.7915.0> (DBConnection.ConnectionPool.Pool) started
Pid: #PID<0.7916.0>
Start Call: DBConnection.Connection.start_link(Postgrex.Protocol, [pool_index: 1, max_restarts: 0, backoff_type: :stop, database: "postgres", telemetry_prefix: [:bonfire, :common, :repo], otp_app: :bonfire_umbrella, types: Bonfire.Geolocate.PostgresTypes, username: "postgres", password: "1af6-4c9d-b518-f10e6c96f518-42665e9d-23b8", hostname: "db", socket_options: [], priv: "priv/repo", slow_query_ms: 100, connect_timeout: 10000, timeout: 20000, parameters: [statement_timeout: "20000", idle_in_transaction_session_timeout: "5000"]], #PID<0.7914.0>, #Reference<0.1782843226.320995329.1398>)
16:26:27.474 [info] Migrate Bonfire.Common.Repo
16:26:27.476 [info] Migrations already up
Migration path: "/opt/app/lib/bonfire_umbrella-0.9.10-classic-beta.2/priv/repo"
Repo: Bonfire.Common.Repo
Status Migration ID Migration Name
--------------------------------------------------
[:ok]
16:26:29.140 [error] GenServer {Oban.Registry, {Oban, {:producer, "federator_incoming"}}} terminating
There are other errors but they feel like issues because the database tables aren't created yet. (public.oban_jobs does not exist) | 16:36:56 |
Mayel | Yes you're already in iex. Indeed, looks the migrations files are missing. Are you able to see what version is running? | 16:38:08 |
Jeff | I tried running bonfire version but it threw an error. I do see this warning in the logs, which mentions 0.1.0-beta.3
16:43:04.063 [info] Loaded instance Settings were loaded into the app's Config
/opt/app/lib/bonfire-0.1.0-beta.3/priv
warning: this clause cannot match because a previous clause at line 9 always matches
│
9 │ def_reverse_router(:path, for: Bonfire.Web.Router, filter: [module: Bonfire.Common.Extend, fun: :module_enabled?])
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 16:45:04 |
Jeff | Before you go too deep in the woods, let me back out and start over with a fresh run. Who knows what I messed up along the way. It may end up with the same results but you never know. | 16:48:01 |
Jeff | Nope, same result. Good to know. | 16:53:17 |
Jeff | I got into the shell (just run-shell db) and under /opt/app/releases I see 0.9.10-classsic-beta.2 | 17:24:02 |
Mayel | Ok, that is the most recent | 19:24:28 |
Mayel | Could you check the output of `ls "/opt/app/lib/bonfire-0.1.0-beta.3/priv/repo/migrations/“` and `ls "/opt/app/lib/bonfire_umbrella-0.9.10-classic-beta.1/priv/repo/migrations/“` in the iex shell? | 19:27:19 |
Jeff | In reply to @mayel:matrix.org Could you check the output of `ls "/opt/app/lib/bonfire-0.1.0-beta.3/priv/repo/migrations/“` and `ls "/opt/app/lib/bonfire_umbrella-0.9.10-classic-beta.1/priv/repo/migrations/“` in the iex shell? In both cases, the migrations folder doesn't exist. In each of the repo folders, there is a single "seed.exs" file, but no other folders or files. | 19:40:05 |
Jeff | In reply to @mayel:matrix.org Could you check the output of `ls "/opt/app/lib/bonfire-0.1.0-beta.3/priv/repo/migrations/“` and `ls "/opt/app/lib/bonfire_umbrella-0.9.10-classic-beta.1/priv/repo/migrations/“` in the iex shell? * In both cases, the migrations folder doesn't exist. In each of the repo folders, there is a single "seeds.exs" file, but no other folders or files. | 19:40:25 |
Mayel | Ok thanks! I might know the issue then (CI is building that image and probably not copying DB migrations from extensions during the build, vs when I build test images locally where that’s already done, will try a fix) | 19:43:22 |
Mayel | In reply to @box464:matrix.org In both cases, the migrations folder doesn't exist. In each of the repo folders, there is a single "seeds.exs" file, but no other folders or files. Alright got a new docker image ready (0.9.10-beta.5) if you could try with that? (Please not there are some refactors in progress so you may experience some oddities with the UI) | 21:48:21 |