-
Notifications
You must be signed in to change notification settings - Fork 235
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
"Permission denied (os error 13)" by running Function on Docker local-dev #1343
Comments
@Pictor13 thanks for the issue. When you say you are using the Also are you developing from inside the container, or just using the container to run your edge functions? Might be helpful to know which OS host you are using. Some more details on how you are developing (vs. the standard flow) and what you are trying to build (code snippets may be useful) would help! cc @supabase/edge-functions |
@Pictor13 Edge Functions don't have permissions to access the filesystem. If you want to read a file, I'd suggest uploading it to Supabase Storage and read from there. Check this example on how to read files from Supabase Storage. |
No, I'm not self-hosted, I'm using the one that is pulled and run out-of-the-box by
hence I suppose
I'm Ubuntu 20.04, running Docker containers natively. Also note that I've run functions before on the same setup; it seem to me something related to the code under But the error is pretty generic and I get no clue of what I am doing wrong and, most importantly, what's the line number triggering the error. |
Thank you @laktek. Also, shelling into the
hence I should have access to the filesystem. |
@Pictor13 Sorry I misunderstood the issue, thought you are referring to reading local files in your function code which isn't supported. Importing local dependencies should work though. Are you on the latest version of CLI? After upgrading the CLI, if you do |
@laktek aah yes, no problem, I misunderstand stuff all the time :) However....I figured out a solution: ensure to not make a single mistake during Once fixed, ensuring that every single Pretty often, using wrong local URIs for Most of the time is I've made a list of different errors I've met by messing out with imports are:
Still I'm not sure what triggered my initial error. I get rid of it by fixing 2 different problems from the list above.
Supabase team (@supabase-automated-user ?) could you confirm my last hypothesis? |
I incurred again the terrible "Permission denied (os error 13)" error. My edge-function stopped being served correctly once I added a Deleting it, the This happens regardless the content of the Deno config file (I tried with Hopefully reporting it here might save some lives & headaches to somebody.... 🙄 |
@Pictor13 Have you upgraded the CLI? Check if you are running a version above 1.68.0+. In the newer versions of the CLI, |
Closing as no longer relevant. Feel free to reopen if there's any issue related to edge runtime. |
Discussed in https://github.com/orgs/supabase/discussions/14996
Originally posted by Pictor13 June 13, 2023
On local-development I seem to have an issue with filesystem permissions, over the
deno
Docker container.When trying to access an Edge Function file, Deno fails with
error: Permission denied (os error 13)
.I
docker-exec -it $deno_container bash
intodocker ps | grep deno
and can see that:id
returns the userdeno
, having UID & GID equal to1993
ls -la /home/deno/functions/my-function/index.ts
shows onwer UID and group GID as equal to1000
1000
is usually corresponding to thedocker
user; when it appears in a container usually is the sign of some volume mount of some sort.Is this the case?
I saw the
/app/Dockerfile
simply copies the files, from localhost to the container, but I don't see why they should have this mismatching file permissions.Can somebody check in their working docker local-dev if the 2 commands above return the same results as me?
At the moment I am unable to test functions locally.
What could be causing the error?
What can I try to restore the correct functionality?
Could this be a bug?
More info
I run:
supabase start
supabase functions serve my-function
--debugit outputs:
Additionally
supabase stop
andstart
again to see if it would reset the image & containers, but nothing changedchmod 777
theindex.ts
file inside the container but userdeno
has no rights to do so andsudo
is not available.The text was updated successfully, but these errors were encountered: