#Passing a directory as argument example from Demo fails when run in root dir on MacOs

1 messages · Page 1 of 1 (latest)

desert cape
#

Hey! I was going through the getting started guide: https://docs.dagger.io/quickstart/292472/arguments#pass-a-directory-as-argument and in this section when I run:

dagger -m github.com/vikram-dagger/daggerverse/fileutils call tree --dir=.

I get the following error:

✔ initialize 3.0s
  ✔ ModuleSource.asModule: Module! 0.9s
  ✔ Module.initialize: Module! 0.4s
    ✔ exec go build -o /runtime . 0.3s
✘ Host.directory(path: "/Users/arsh"): Directory! 0.0s
  ✔ upload /Users/arsh from Arsh-Sharma.local (client id: r9ip00evp2xwrlfxu5takft8p) 0.0s

Error: response from query: input: host.directory resolve: host directory /Users/arsh: error from sender: open /Users/arsh/.Trash: operation not permitted

Even running the command with sudo doesn't fix it. I guess it's a permissions issue because I'm trying to run it at /Users/arsh or is something else causing a problem?

Also if others faced this as well should we maybe add a note in the getting started guide about it? Like "Running this command in the home directory might cause an error" or something like that.

Thanks!

Pass arguments to a function

#

Okay tried running it in a different directory and it failed there as well:

dagger -m github.com/vikram-dagger/daggerverse/fileutils call tree --dir=.
✘ Host.directory(path: "/Users/arsh/Movies"): Directory! 5m56.4s
  ✘ copy upload /Users/arsh/Movies from Arsh-Sharma.local (client id: j4gjij4oxsi3fq5ad4c7wfv5v) 22.2s

Error: response from query: input: host.directory resolve: host directory /Users/arsh/Movies: failed to copy files: copy file range failed: no space left on device
#

It did work in a different directory which just had three text files.

vagrant root
#

@desert cape when you import local files into Dagger, they are uploaded into the engine container, and hashed. So you can run into issues if you do this on truly huge directories, or directories which can't be copied.

In this case (no space left on device) there's nothing preventing you from uploading a bunch of large video files to Dagger - as long as you have the space on the machine running the engine. In this case, the issue might be lack of space on the Docker for Mac VM

desert cape
#

Ah makes sense, thanks! So in the first case it failed because it didn't have permissions to upload "/Users/arsh/.Trash" to the engine container?

vagrant root
#

the way eg. rsync does