Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lando changes uid/gid of the solr user, causing lando restart to fail #79

Open
tobybellwood opened this issue Jun 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tobybellwood
Copy link
Collaborator

You can see here, in this example that the /tmp/ready file (part of the lagoon entrypoints has been created by the solr user (uid:8983 and gid:8983) - but by the time the pod is running, the solr user is now 1000:1000 - and no longer has access to the file/folders created in the entrypoint/startup.

This means that any subsequent lando restarts fail at the entrypoint not being writable by the new solr user. Even when the entrypoint is bypassed (by run_as_root rm /tmp/ready) solr failed to start because of folder access permissions.

Do you have any idea why this uid/gid rewriting is being done - is there some lando-ism I'm missing?

Here are some vitals:

 NAME      drupal-solr                                        
 LOCATION  /home/tobybellwood/sites/drupal9-solr              
 SERVICES  cli, nginx, php, mariadb, solr, mailhog, lagooncli 
 URLS                                                         
  ✔ NGINX URLS
    ✔ http://localhost:32774 [302]
    ✔ http://nginx.drupal-solr.lndo.site:8000/ [302]
    ✔ https://nginx.drupal-solr.lndo.site:444/ [302]
    ✔ http://drupal-solr.lndo.site:8000/ [302]
    ✔ https://drupal-solr.lndo.site:444/ [302]
  ✔ SOLR URLS
    ✔ http://localhost:32773 [302]
  ✔ MAILHOG URLS
    ✔ http://localhost:32771 [200]
    ✔ http://inbox.drupal-solr.lndo.site:8000/ [200]
 
tobybellwood@pop-os:~/sites/drupal9-solr$ lando ssh -s solr
[drupal-solr]solr:/app$ ls -al /tmp/ready
-rw-rw-r-- 1 8983 8983 0 Jun 27 05:31 /tmp/ready
[drupal-solr]solr:/app$ ls -al /var/solr
ls: cannot open directory '/var/solr': Permission denied
[drupal-solr]solr:/app$ ls -al /var | grep solr
drwxrwx--- 5 8983  8983 4096 Jun 27 05:31 solr
[drupal-solr]solr:/app$ whoami
solr
[drupal-solr]solr:/app$ id
uid=1000(solr) gid=1000(solr) groups=1000(solr)

I've also replicated this in our varnish example - as this is another service that uses a named user

@tobybellwood tobybellwood added the bug Something isn't working label Jun 27, 2024
@reynoldsalec
Copy link
Member

@tobybellwood Lando maps the host user's uid/gid onto the container user, see https://github.com/lando/core/blob/main/scripts/user-perms.sh#L94 and the associated helper . Typically that should mean uid/gid is 501 on a Mac.

My guess is that, in this case, the /tmp/ready file is being created before that mapping occurs.

@pirog you have any suggestions on how to sidestep this issue on Lando 3 services?

@rrdgcoks
Copy link

I can help test any solution because I'm having this issue locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants