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

Cable - Operation not permitted - bs_fetch:atomic_write_cache_file:chmod (Errno::EPERM) #1

Closed
PabloC opened this issue Jan 9, 2021 · 12 comments

Comments

@PabloC
Copy link

PabloC commented Jan 9, 2021

Hi Nick, first of all, thank you so much for sharing this excellent piece of code.

I am testing it, a fresh install, and during the build I'am getting an error in the Cable part of the docker-compose.

"Operation not permitted - bs_fetch:atomic_write_cache_file:chmod (Errno::EPERM)"

Captura de pantalla 2021-01-09 a las 4 52 51

Any idea on what is going on? I believe Cable is looking for a temporary directory but cannot find exactly which is and why can't be used.

@nickjj
Copy link
Owner

nickjj commented Jan 9, 2021

Hi,

I just freshly cloned this repo and upped everything but I don't see this error. What's the full stack trace?

Did you make any changes to the code, even something minor like doing a find / replace to swap the project name? Did the other services such as the web and worker start successfully?

Have you tried stopping the project and doing a run clean to clear your cache and other tmp files?

  • What OS / version are you using?
    • If you're on Windows are you using WSL 1 or WSL 2? If so which distro?
  • What is the output of running id on your dev box?
  • What version of Docker are you using?

@PabloC
Copy link
Author

PabloC commented Jan 9, 2021

Hi Nick, I did a run clean and now it is working great. Thank you so much for your fast help!

@PabloC PabloC closed this as completed Jan 9, 2021
@nickjj
Copy link
Owner

nickjj commented Jan 9, 2021

The question now is what caused you to need to clean things manually.

Can you give an order of operations of what you did starting from cloning the repo to producing that error?

@PabloC
Copy link
Author

PabloC commented Jan 9, 2021

I tried again in a new mac, and it's giving the same error the first time it stgarts.

this are the commands I used:

  • 873 cd Proyectos
  • 874 git clone https://github.com/nickjj/docker-rails-example hellorails
  • 875 cd hellorails
  • 876 l
  • 877 cp .env.example .env
  • 878 cp docker-compose.override.yml.example docker-compose.override.yml
  • 879 docker-compose up --build

and the log output

https://pastebin.com/ctVJjG54

@nickjj
Copy link
Owner

nickjj commented Jan 9, 2021

It looks like it's happening on the web service too.

After the first upping, what is the output of running these commands from the root of the project:

  • ls -la
  • ls -la tmp/

@PabloC
Copy link
Author

PabloC commented Jan 9, 2021

Sure, this is the output: https://pastebin.com/9xmXEEd4

to replicate it again, y removed the images and volumes and started again. And still happens.

/usr/local/bundle/gems/bootsnap-1.5.1/lib/bootsnap/compile_cache/iseq.rb:30:in `fetch': Operation not permitted - bs_fetch:atomic_write_cache_file:chmod (Errno::EPERM)

Using docker for Mac

Screenshot 2021-01-09 at 21 00 51

Maybe it's related to this bug:
Shopify/bootsnap#262

What about this?
Shopify/bootsnap#262 (comment)

@nickjj
Copy link
Owner

nickjj commented Jan 9, 2021

Thanks, and what's the output of running id on your dev box?

Also for total clarity, everything works as long as you stop + clear + up everything as normal with docker-compose up? Do any of the file permissions change on your host OS after the 2nd up?

As for those issues it's not impossible, but I run Docker Desktop here on Windows with WSL 2 and I haven't seen it pop up. That would mean it could be specific to macOS which seems even more strange.

I wonder if it has to do with your user and group not being the same. In my dev env everything is owned by nick:nick with a uid:gid of 1000. The image is configured to run things without root.

Another possible thing to test would be to comment out all of the volume lines in the docker-compose.yml file related to the web, worker and cable services just to see if it's related to file permissions between the container and host.

@PabloC
Copy link
Author

PabloC commented Jan 10, 2021

id on my dev box:

uid=501(pibefision) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.2),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae)

The errors appears only on a cold docker-compose, just the first time. The second time I launch it does not appear. I've tested in two different macs.

@nickjj
Copy link
Owner

nickjj commented Jan 10, 2021

Is that a fresh install of macOS without doing anything out of the ordinary with your user / groups?

Is the 2nd launch tied into clearing the cache in between or can you launch it a 2nd time directly after the first and it works?

@PabloC
Copy link
Author

PabloC commented Jan 10, 2021

fresh install.

2nd lauch without clearing anything.

@nickjj
Copy link
Owner

nickjj commented Jan 10, 2021

Thanks, what version of macOS are you using btw? That'll help anyone else who gets the same issue. Maybe I can call out the error in the docs until it's officially fixed by Bootsnap.

Also speaking of which, would you mind trying to do a first launch test again, but this time with Bootsnap disabled before you start everything up? You can goto config/boot.rb and comment out the require "bootsnap/setup" line to disable it quickly. If it works then we know for sure it's related to Bootsnap.

@PabloC
Copy link
Author

PabloC commented Jan 10, 2021

Yes sir, after a clean install, I disabled Bootsnap with a comment in config/boot.rb and now works. It seems an issue related to Bootsnap.

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

No branches or pull requests

2 participants