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

Changing sshfs cache default to false in https://github.com/lima-vm/lima/pull/538 is breaking php composer install in host mounted volumes #1349

Closed
dschaaff opened this issue Jan 26, 2022 · 1 comment · Fixed by #1423
Labels
component/lima Issues related to lima and qemu kind/bug Something isn't working
Milestone

Comments

@dschaaff
Copy link

Rancher Desktop Version

1.0.0

Rancher Desktop K8s Version

1.22.2

What operating system are you using?

macOS

Operating System / Build Version

12.1

What CPU architecture are you using?

arm64 (Apple Silicon)

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

Actual Behavior

We have some php development stacks that use a docker compose file. The code directory is mounted into the container using a bind mount.

volumes:
    - type: bind
      source: ./../
      target: /var/www

We edit code directly on the macOS host and rely upon these changes showing up in the container. In this case macOS is the source of truth. The one exception is running composer install from inside the container. In that case the container is making the file system changes and we rely on those being reflected back on the host. This scenario was working great in Rancher Desktop 0.7.1. Upon upgrading to 1.0.0 we immediately began seeing failures running composer install.

Plugin kylekatarnls/update-helper could not be initialized, class not found: UpdateHelper\ComposerPlugin

I could work around that specific issue by running composer global require kylekatarnls/update-helper . There was very strange behavior when running composer install afterward though. We would see each dependency show up in the vendor folder, then disappear, and then be replaced by a different dependency. When composer install had finished there was only a single dependency in the vendor folder.


Updating the override.yaml file to re-enable sshfs caching fixes the issue.

mounts:
- location: "~"
  sshfs:
    cache: true

With that change in place composer install correctly runs inside the container.

Steps to Reproduce

Setup rancher desktop 1.0.0.
Run composer install from inside of a host mounted directory.

Result

Files appear and disappear.

Expected Behavior

Composer install completes successfully with all files reflected on the host filesystem.

Additional Information

No response

@dschaaff dschaaff added the kind/bug Something isn't working label Jan 26, 2022
@dschaaff
Copy link
Author

dschaaff commented Jan 27, 2022

I have created a sample project here that reproduces the issue https://github.com/dschaaff/rancher-desktop-issue-1349

To reproduce

  • ensure Rancher Desktop 1.0.0 is in dockerd mode and override.yml is empty
  • install the docker-compose cli plugin if necessary
  • clone https://github.com/dschaaff/rancher-desktop-issue-1349
  • run docker-compose up -d
  • exec into container docker-compose exec php bash
  • run composer install
  • observe the vendor folder in finder while the operation is running. you will see folders appearing and then disappearing
    Observe the error
root@0be843f86b29:/var/www# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 48 installs, 0 updates, 0 removals
  - Installing kylekatarnls/update-helper (1.2.1): Downloading (100%)
Plugin installation failed (Plugin kylekatarnls/update-helper could not be initialized, class not found: UpdateHelper\ComposerPlugin), rolling back
  - Removing kylekatarnls/update-helper (1.2.1)


  [UnexpectedValueException]
  Plugin kylekatarnls/update-helper could not be initialized, class not found: UpdateHelper\ComposerPlugin
  • quit rancher desktop
  • update override.yml to enable sshfs cache
mounts:
- location: "~"
  sshfs:
    cache: true
  • relaunch rancher desktop
  • run docker-compose up -d
  • exec into pod docker-compose exec php bash
  • run composer install

Observe that the command now executes successfully.

@evertonlperes evertonlperes added the component/lima Issues related to lima and qemu label Jan 27, 2022
jandubois added a commit to rancher-sandbox/lima that referenced this issue Jan 29, 2022
This was changed to `false` in lima 0.8.0:

* lima-vm#538

It has generated multiple reports of breaking PHP package manager,
unit tests, and file system access itself:

* lima-vm#556
* abiosoft/colima#129
* rancher-sandbox/rancher-desktop#1349

Signed-off-by: Jan Dubois <[email protected]>
@jandubois jandubois added this to the v1.0.1 milestone Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lima Issues related to lima and qemu kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants