Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] Operation not permitted (ix-file-permissions.sh) #3837

Closed
varioous opened this issue Oct 17, 2023 · 2 comments
Closed

[BUG] Operation not permitted (ix-file-permissions.sh) #3837

varioous opened this issue Oct 17, 2023 · 2 comments

Comments

@varioous
Copy link

varioous commented Oct 17, 2023

When starting solr service the start fails everytime with:

ddev logs -s solr /opt/solr/docker/scripts/solr-foreground: running /docker-entrypoint-initdb.d/as-sudo/fix-file-permissions.sh chown: changing ownership of '/var/solr/data/cores': Operation not permitted

Steps to reproduce the behavior:
.ddev-docker-compose.solr.yaml

services:
  solr:
    container_name: ddev-${DDEV_SITENAME}-solr
    image: typo3solr/ext-solr:12.0.x-dev
    ports:
      - 8983
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    environment:
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - HTTP_EXPOSE=8983
    volumes:
      - ./solr/cores:/var/solr/data/cores
      - solr:/var/solr
  web:
    links:
      - solr

volumes:
  solr:

Expected behavior
Solr started successfully

Used versions:

  • TYPO3 Version:12.4
  • EXT:solr Version: 12.0.0

Additional context
Setup: Windows + Docker-Desktop + WSL2

@dkd-kaehm
Copy link
Collaborator

@varioous
The path .ddev/solr/cores is mounted to the exported docker volume without synchronize the unix user ids.
In Apache Solr and EXT:solr docker images, the service runs with unix user id 8983, your host user has other UID.
The circular bind mounts .ddev/solr/cores on sub path of exported docker volume is not good idea.

If you want to enable/disable cores, use the provided feature ENV-"TYPO3_SOLR_ENABLED_CORES":
https://docs.typo3.org/p/apache-solr-for-typo3/solr/12.0/en-us/Appendix/DockerTweaks.html
If not, then just remove the - ./solr/cores:/var/solr/data/cores line.

If you want for example deploying the stuff from your git repo to Apache Solr Service/Stages,
or test some changes on Schemas, etc,
then inspire you from our solr-ddev-site.

We'll not fix the "specials" like this, to avoid even more complexity, but we want to document the Docker Build tweak of EXT:solr image on #3838.

@itzonban
Copy link

itzonban commented Nov 7, 2024

Hi,

I also ran into this issue (switching from 11.5 to 12.0.5) and I think I found the cause of it:

In v11.6 you introduced the new files here. The workflow is supposed to be that the as-sudo-tweaks.sh is called and then all scripts inside the folder as-sudo are executed with sudo permissions.

But in the solr Docker, which your image is based on, the runinit-db script is looking for files to execute with this command:

find /docker-entrypoint-initdb.d/ -mindepth 1 -type f | sort -n

which in your case results in the following output order:

/docker-entrypoint-initdb.d/as-sudo/fix-file-permissions.sh
/docker-entrypoint-initdb.d/as-sudo-tweaks.sh
/docker-entrypoint-initdb.d/disable-cores.sh

So the fix-file-permissions.sh inside the as sudo folder will be executed first and this without sudo permission - this causes the Operation not permitted failure trying to change the file permissions and aborts the container. By either renaming the as-sudo folder or the as-sudo-tweaks.sh to offer the correct file order in the sorting this issue should be fixed.

Best regards
Daniel

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants