[16:05:17] | * farmBOT has joined #farmos |
[16:50:39] | * riotmiked[m] has joined #farmos |
[16:50:40] | <riotmiked[m]> | OK, I have a DUMB problem that has taken me hours of troubleshooting that I'm really tired of so I'll relent and ask for help. I'm spinning up a new local FarmOS instance after relying on farmier for a while. I have the following error showing up during the module install phase of setup. Does anyone know what this is? Drush output:... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/gevtrFUvJJGvvvEQ...) |
[16:53:45] | * postmanpat[m] has joined #farmos |
[16:53:45] | <postmanpat[m]> | riotmiked: looks like my problem. I had mkdir error too. |
[16:53:55] | <riotmiked[m]> | What I've been thinking is a permissions issue on the host system (docker dev implementation). |
[16:54:38] | <postmanpat[m]> | you read this? |
[16:54:38] | <postmanpat[m]> | https://farmos.discourse.group/t/default-theme-only-works-in-maintenance... |
[16:59:06] | <riotmiked[m]> | No, that's good info, thanks. Did you resolve? |
[17:06:48] | <postmanpat[m]> | <riotmiked[m]> "No, that's good info, thanks..." <- Nah.. not quite yet. |
[17:16:34] | <postmanpat[m]> | Permissions is difficult... Had big problems with this on my nextcloud too. So many ways to go wrong, and so few to make it right |
[17:20:18] | <mstenta[m]> | riotmiked: When the farmOS API module (`farm_api`) gets installed, it will attempt to create key files for OAuth. |
[17:20:21] | <mstenta[m]> | Here's where that happens: https://github.com/farmOS/farmOS/blob/3a73ccf6360ba309ee657e2d645d29c239... |
[17:22:46] | <mstenta[m]> | I'm refreshing on how I handle that in Farmier... but basically I create the keys ahead of time so farm_api doesn't need to. |
[17:22:57] | <mstenta[m]> | (That code only runs if it detects that the key files don't exist) |
[17:24:50] | <mstenta[m]> | OK so... what I do is create a keys directory with a public.key and private.key, and then bind-mount that into the Docker container under /opt/drupal/keys |
[17:25:07] | <mstenta[m]> | That's where farm_api looks. So if it finds the keys there it won't try to create them. |
[17:26:05] | <mstenta[m]> | What you could do is... create a keys directory (outside of the container) that you bind-mount in under /opt/drupal/keys, and let farm_api generate the keys. As long as that directory is writable by www-data (inside the container), then farm_api will be able to generate them. |
[17:26:09] | <riotmiked[m]> | <mstenta[m]> "riotmiked: When the farmOS API..." <- Ah, thanks. I am mapping sites to /opt/drupal/web/sites in the Docker container. per production docker-compose. I'll create some OAuth keys and do what you're doing. |
[17:26:24] | <mstenta[m]> | The tricky thing (always, and as postmanpat said) is permissions :-/ |
[17:26:37] | <mstenta[m]> | Because every environment might be a little different |
[17:28:12] | <mstenta[m]> | Now that I think about it... we might be lacking proper documentation of this keys directory setup |
[17:28:17] | <riotmiked[m]> | mstenta[m]: I think I have permissions nailed pretty good (all on www-data user/group on host system). But, I'm not sure. The fact that it can't create the directory has me concerned, considering it's in Docker and I'm not bind-mounting to that dir. |
[17:28:55] | <mstenta[m]> | So... there's a bit of a "gotcha" in the farmOS dev container (if that's what you're using). |
[17:29:18] | <mstenta[m]> | The dev container changes the user ID of www-data. |
[17:29:20] | <riotmiked[m]> | I'm simply doing the sites -> /opt/drupal/web/sites as recommended for production systems (for upgrades!). |
[17:29:38] | <mstenta[m]> | What docker image are you using? |
[17:29:40] | <riotmiked[m]> | mstenta[m]: Ah, that's good to know! |
[17:29:56] | <riotmiked[m]> | image: farmos/farmos:3.2.3 |
[17:30:16] | <mstenta[m]> | Oh ok great, so www-data should be uid 33 (default in Debian) |
[17:30:32] | <mstenta[m]> | But....... that might NOT be the same www-data uid as your host system. So I would check that! |
[17:30:52] | <mstenta[m]> | On your host system, run id -u www-data |
[17:31:01] | <mstenta[m]> | That will tell you the user ID of www-data |
[17:31:42] | <riotmiked[m]> | It's 33, so far so good. |
[17:31:46] | <mstenta[m]> | When working with Docker and bind-mounted permissions, a linux user NAME is not really reliable. You have to make sure that the user ID is what it needs to be. |
[17:31:53] | <mstenta[m]> | Ah good. |
[17:32:46] | <mstenta[m]> | So, I would recommend bind-mounting another directory for /opt/drupal/keys, and make sure that it is writable by www-data |
[17:33:13] | <mstenta[m]> | (Before you install farmOS... because farm_api will only try to create those files the first time it's installed.) |
[17:33:16] | <riotmiked[m]> | OK, will do, then we'll see - ok headed to kid pickup! I'll check this later, and thanks for the direction! |
[17:33:27] | <mstenta[m]> | Dinner time here... I have to run... hope this helps! I'll try to check back in later. |
[17:34:31] | <mstenta[m]> | > hours of troubleshooting that I'm really tired of so I'll relent and ask for help |
[17:34:31] | <mstenta[m]> | oh and don't hesitate to ask here first next time!! 😅 |
[17:34:49] | <mstenta[m]> | Happy to help (or others can)! |
[18:48:53] | <riotmiked[m]> | <mstenta[m]> "> hours of troubleshooting..." <- > <@mstenta:matrix.org> > hours of troubleshooting that I'm really tired of so I'll relent and ask for help... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/XnuJZIHGssEwtarT...) |
[19:03:39] | <riotmiked[m]> | ACTION uploaded an image: (123KiB) < https://matrix.org/_matrix/media/v3/download/matrix.org/kPgDWwQXepuUwXQL... > |
[19:04:49] | <riotmiked[m]> | OK, I was able to eliminate the error using the steps you recommended! However, I'm not out of the woods - the initial setup still gets stuck at this step. I still have 2 warnings in the drush log. Here's the first: |
[19:04:53] | <riotmiked[m]> | 9 26/Aug 17:01 php Warning Warning: is_dir(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/ImfZPkKiCeqvWIrV...) |
[19:05:39] | <riotmiked[m]> | The second is similar |
[19:08:36] | <mstenta[m]> | To fix that, you need to make /opt/drupal/sites/default writable by www-data |
[19:09:20] | <mstenta[m]> | Oh and also set up a private files directory |
[19:10:49] | <mstenta[m]> | https://farmos.org/hosting/install/#file-uploads |
[19:12:34] | <mstenta[m]> | I'm not sure if thats causing the installer to hang though... 🤔 |
[19:13:18] | <mstenta[m]> | But maybe |
[19:13:26] | <riotmiked[m]> | On a clean install, the directory `default` doesn't exist. I see on the bind-mounted directory that it is indeed NOT writable by www-data: |
[19:13:26] | <riotmiked[m]> | dr-xr-xr-x 3 www-data www-data 4096 Aug 26 17:00 default |
[19:13:48] | <mstenta[m]> | Hmm it should exist 🤔 |
[19:15:14] | <riotmiked[m]> | Well, what I mean is that on a "clean" install, where I've just created an empty directory called sites, then run docker-compose to instantiate, it's empty initially, then gets populated. |
[19:16:14] | <mstenta[m]> | Ah ok yes |
[19:16:25] | <riotmiked[m]> | My current procedure:... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/BbPjNoIBRGAwwuyL...) |
[19:16:44] | <riotmiked[m]> | then docker-compose up -d |
[19:17:08] | <mstenta[m]> | Ok thanks! Makes sense |
[19:17:48] | <mstenta[m]> | So I wonder: if you left out the mkdir steps... Docker will create the directories itself... maybe it will work then? |
[19:18:16] | <riotmiked[m]> | I will try that - I was getting an error before, but I agree that should work |
[19:19:27] | <mstenta[m]> | Ok yea. I'm not in front of my computer at the moment so working from memory 😅 |
[19:23:15] | <mstenta[m]> | It would be good to figure out (and your issue too postmanpat) and add more docs if we need to |
[19:29:55] | <riotmiked[m]> | <mstenta[m]> "It would be good to figure out..." <- I am QUITE dedicated to documenting whatever I find out in a blog post. May not be applicable to all, but will definitely be applicable if, like me, you have:... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/kQqstKUsfCwcxOhf...) |
[19:33:28] | <riotmiked[m]> | <mstenta[m]> "So I wonder: if you left out the..." <- I tried this and it was a step backwards, unfortunately. Some takeaways:... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/mKDodcGOPvylblLi...) |
[19:36:49] | <riotmiked[m]> | ACTION sent a code block: https://matrix.org/_matrix/media/v3/download/matrix.org/cuvBYAvvUTNMzavQ... |
[19:37:40] | <riotmiked[m]> | not a very complicated setup... I'm posting this here in case I'm doing something really dumb that someone sees. |
[19:45:44] | <mstenta[m]> | Hmm not sure about dblog (maybe related), but what are the owner/group/perms of sites/default? |
[19:47:51] | <riotmiked[m]> | I removed the global volumes section from the docker-compose.yml then deleted/restarted and dblog is working again. Odd, but maybe not related. At any rate, back to having the warnings. |
[19:47:51] | <mstenta[m]> | (After docker compose up populates sites) |
[19:48:01] | <riotmiked[m]> | mstenta[m]: drwxr-xr-x 3 www-data www-data 4096 Jul 21 07:28 sites |
[19:48:24] | <mstenta[m]> | Ah interesting. I wondered about the global volumes. |
[19:48:36] | <riotmiked[m]> | ACTION sent a code block: https://matrix.org/_matrix/media/v3/download/matrix.org/vwzdQnYQQrqkHUgr... |
[19:49:35] | <riotmiked[m]> | default dir starts without drw for www-data, which is odd. |
[19:49:36] | <mstenta[m]> | Ok what if you chmod ug+w default |
[19:50:01] | <riotmiked[m]> | mstenta[m]: Can do! Do i do that before module install? |
[19:50:25] | <mstenta[m]> | Yea so its best practice to make default read only by the webserver. But I'm curious if this will lead us to some clues. |
[19:50:48] | <mstenta[m]> | I think Drupal will actually remove write access to default if it detects it. |
[19:51:17] | <mstenta[m]> | Yes try docker compose up, then chmod, then open in browser to do a site install |
[19:51:45] | <mstenta[m]> | (I'm assuming starting from scratch with no volumes/db) |
[19:52:48] | <mstenta[m]> | Sorry I'd probably be able to help more if I could look/test directly... but curious to figure it out |
[19:53:03] | <mstenta[m]> | If not today then maybe on the Thurs dev call? |
[19:56:24] | <mstenta[m]> | Is there a sites/default/files directory after docker-compose up? |
[19:56:54] | <riotmiked[m]> | mstenta[m]: yes |
[19:57:10] | <mstenta[m]> | Is it writeable by www-data? |
[19:57:49] | <riotmiked[m]> | looks like it. I also just did your suggested chmod ug+w default and checking... |
[19:58:47] | <mstenta[m]> | So in theory you just want sites/default/files writeable. But sites/default should be read only (so set it back afterwards) |
[19:59:26] | <riotmiked[m]> | Ugh. Still no dice! Warnings in the drush log, and stuck on "Initializing." step of ##Installing farmOS modules##. Oh well..... |
[19:59:53] | <mstenta[m]> | The warnings are not a deal breaker |
[19:59:53] | <riotmiked[m]> | ACTION sent a code block: https://matrix.org/_matrix/media/v3/download/matrix.org/YrPNtCUGMhjwwWRz... |