| 20:05 | * | farmBOT has joined |
| 20:50 | * | riotmiked[m] has joined |
| 20:50 | 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 <matrix.org/_matrix/media/v3/download/mat>) |
| 20:53 | * | postmanpat[m] has joined |
| 20:53 | postmanpat[m] | riotmiked: looks like my problem. I had mkdir error too. |
| 20:53 | riotmiked[m] | What I've been thinking is a permissions issue on the host system (docker dev implementation). |
| 20:54 | postmanpat[m] | you read this? |
| 20:54 | postmanpat[m] | farmos.discourse.group/t/default-theme-o |
| 20:59 | riotmiked[m] | No, that's good info, thanks. Did you resolve? |
| 21:06 | postmanpat[m] | <riotmiked[m]> "No, that's good info, thanks..." <- Nah.. not quite yet. |
| 21:16 | 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 |
| 21:20 | mstenta[m] | riotmiked: When the farmOS API module (`farm_api`) gets installed, it will attempt to create key files for OAuth. |
| 21:20 | mstenta[m] | Here's where that happens: github.com/farmOS/farmOS/blob/3a73ccf636 |
| 21:22 | 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. |
| 21:22 | mstenta[m] | (That code only runs if it detects that the key files don't exist) |
| 21:24 | 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 |
| 21:25 | mstenta[m] | That's where farm_api looks. So if it finds the keys there it won't try to create them. |
| 21:26 | 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. |
| 21:26 | 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. |
| 21:26 | mstenta[m] | The tricky thing (always, and as postmanpat said) is permissions :-/ |
| 21:26 | mstenta[m] | Because every environment might be a little different |
| 21:28 | mstenta[m] | Now that I think about it... we might be lacking proper documentation of this keys directory setup |
| 21:28 | 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. |
| 21:28 | mstenta[m] | So... there's a bit of a "gotcha" in the farmOS dev container (if that's what you're using). |
| 21:29 | mstenta[m] | The dev container changes the user ID of www-data. |
| 21:29 | riotmiked[m] | I'm simply doing the sites -> /opt/drupal/web/sites as recommended for production systems (for upgrades!). |
| 21:29 | mstenta[m] | What docker image are you using? |
| 21:29 | riotmiked[m] | mstenta[m]: Ah, that's good to know! |
| 21:29 | riotmiked[m] | image: farmos/farmos:3.2.3 |
| 21:30 | mstenta[m] | Oh ok great, so www-data should be uid 33 (default in Debian) |
| 21:30 | mstenta[m] | But....... that might NOT be the same www-data uid as your host system. So I would check that! |
| 21:30 | mstenta[m] | On your host system, run id -u www-data |
| 21:31 | mstenta[m] | That will tell you the user ID of www-data |
| 21:31 | riotmiked[m] | It's 33, so far so good. |
| 21:31 | 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. |
| 21:31 | mstenta[m] | Ah good. |
| 21:32 | mstenta[m] | So, I would recommend bind-mounting another directory for /opt/drupal/keys, and make sure that it is writable by www-data |
| 21:33 | mstenta[m] | (Before you install farmOS... because farm_api will only try to create those files the first time it's installed.) |
| 21:33 | riotmiked[m] | OK, will do, then we'll see - ok headed to kid pickup! I'll check this later, and thanks for the direction! |
| 21:33 | mstenta[m] | Dinner time here... I have to run... hope this helps! I'll try to check back in later. |
| 21:34 | mstenta[m] | > hours of troubleshooting that I'm really tired of so I'll relent and ask for help |
| 21:34 | mstenta[m] | oh and don't hesitate to ask here first next time!! 😅 |
| 21:34 | mstenta[m] | Happy to help (or others can)! |
| 22:48 | 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 <matrix.org/_matrix/media/v3/download/mat>) |
| 23:03 | * | uploaded an image: (123KiB) < matrix.org/_matrix/media/v3/download/mat > |
| 23:04 | 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: |
| 23:04 | 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 <matrix.org/_matrix/media/v3/download/mat>) |
| 23:05 | riotmiked[m] | The second is similar |
| 23:08 | mstenta[m] | To fix that, you need to make /opt/drupal/sites/default writable by www-data |
| 23:09 | mstenta[m] | Oh and also set up a private files directory |
| 23:10 | mstenta[m] | farmos.org/hosting/install/#file-uploads |
| 23:12 | mstenta[m] | I'm not sure if thats causing the installer to hang though... 🤔 |
| 23:13 | mstenta[m] | But maybe |
| 23:13 | 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: |
| 23:13 | riotmiked[m] | dr-xr-xr-x 3 www-data www-data 4096 Aug 26 17:00 default |
| 23:13 | mstenta[m] | Hmm it should exist 🤔 |
| 23:15 | 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. |
| 23:16 | mstenta[m] | Ah ok yes |
| 23:16 | riotmiked[m] | My current procedure:... (full message at <matrix.org/_matrix/media/v3/download/mat>) |
| 23:16 | riotmiked[m] | then docker-compose up -d |
| 23:17 | mstenta[m] | Ok thanks! Makes sense |
| 23:17 | mstenta[m] | So I wonder: if you left out the mkdir steps... Docker will create the directories itself... maybe it will work then? |
| 23:18 | riotmiked[m] | I will try that - I was getting an error before, but I agree that should work |
| 23:19 | mstenta[m] | Ok yea. I'm not in front of my computer at the moment so working from memory 😅 |
| 23:23 | mstenta[m] | It would be good to figure out (and your issue too postmanpat) and add more docs if we need to |
| 23:29 | 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 <matrix.org/_matrix/media/v3/download/mat>) |
| 23:33 | 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 <matrix.org/_matrix/media/v3/download/mat>) |
| 23:36 | * | sent a code block: matrix.org/_matrix/media/v3/download/mat |
| 23:37 | riotmiked[m] | not a very complicated setup... I'm posting this here in case I'm doing something really dumb that someone sees. |
| 23:45 | mstenta[m] | Hmm not sure about dblog (maybe related), but what are the owner/group/perms of sites/default? |
| 23:47 | 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. |
| 23:47 | mstenta[m] | (After docker compose up populates sites) |
| 23:48 | riotmiked[m] | mstenta[m]: drwxr-xr-x 3 www-data www-data 4096 Jul 21 07:28 sites |
| 23:48 | mstenta[m] | Ah interesting. I wondered about the global volumes. |
| 23:48 | * | sent a code block: matrix.org/_matrix/media/v3/download/mat |
| 23:49 | riotmiked[m] | default dir starts without drw for www-data, which is odd. |
| 23:49 | mstenta[m] | Ok what if you chmod ug+w default |
| 23:50 | riotmiked[m] | mstenta[m]: Can do! Do i do that before module install? |
| 23:50 | 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. |
| 23:50 | mstenta[m] | I think Drupal will actually remove write access to default if it detects it. |
| 23:51 | mstenta[m] | Yes try docker compose up, then chmod, then open in browser to do a site install |
| 23:51 | mstenta[m] | (I'm assuming starting from scratch with no volumes/db) |
| 23:52 | mstenta[m] | Sorry I'd probably be able to help more if I could look/test directly... but curious to figure it out |
| 23:53 | mstenta[m] | If not today then maybe on the Thurs dev call? |
| 23:56 | mstenta[m] | Is there a sites/default/files directory after docker-compose up? |
| 23:56 | riotmiked[m] | mstenta[m]: yes |
| 23:57 | mstenta[m] | Is it writeable by www-data? |
| 23:57 | riotmiked[m] | looks like it. I also just did your suggested chmod ug+w default and checking... |
| 23:58 | mstenta[m] | So in theory you just want sites/default/files writeable. But sites/default should be read only (so set it back afterwards) |
| 23:59 | riotmiked[m] | Ugh. Still no dice! Warnings in the drush log, and stuck on "Initializing." step of ##Installing farmOS modules##. Oh well..... |
| 23:59 | mstenta[m] | The warnings are not a deal breaker |
| 23:59 | * | sent a code block: matrix.org/_matrix/media/v3/download/mat |