Skip to content

cro run attempts to read all directories on start and fails when lacking privileges #128

@camstuart

Description

@camstuart

Hi,

I am using a docker-compose.yml to start up postgres in my Cro application with the data directory mounted in the top level of my project.

But because the directory is created by docker, it is not readable to the user launching cro run. Oddly, cro run seems to be attempting to scan all directories, and when it hits this one, it fails.

You can replicate this very easily in an existing Cro project like so:

sudo mkdir foo
sudo chmod -R 600 foo
cro run

Exception:

A react block:
  in sub run-services at /home/cam/rakudo/share/perl6/site/sources/2F5DE0083923025BCEC5898DAEB588F0A0CEBDC3 (Cro::Tools::CLI) line 227
  in sub MAIN at /home/cam/rakudo/share/perl6/site/sources/2F5DE0083923025BCEC5898DAEB588F0A0CEBDC3 (Cro::Tools::CLI) line 199
  in block <unit> at /home/cam/rakudo/share/perl6/site/resources/31DFBB60DDF0B7CC0994DED3586AF43BA050D249 line 1
  in sub MAIN at /home/cam/rakudo/share/perl6/site/bin/cro line 3
  in block <unit> at /home/cam/rakudo/share/perl6/site/bin/cro line 1

Died because of the exception:
    Failed to get the directory contents of '/home/cam/dev/github.com/camstuart/raku-cro-realworld-example-api-app/foo': Failed to open dir: Permission denied
      in sub run-services at /home/cam/rakudo/share/perl6/site/sources/2F5DE0083923025BCEC5898DAEB588F0A0CEBDC3 (Cro::Tools::CLI) line 227
      in sub MAIN at /home/cam/rakudo/share/perl6/site/sources/2F5DE0083923025BCEC5898DAEB588F0A0CEBDC3 (Cro::Tools::CLI) line 199
      in block <unit> at /home/cam/rakudo/share/perl6/site/resources/31DFBB60DDF0B7CC0994DED3586AF43BA050D249 line 1
      in sub MAIN at /home/cam/rakudo/share/perl6/site/bin/cro line 3
      in block <unit> at /home/cam/rakudo/share/perl6/site/bin/cro line 1

Is there perhaps a way of telling cro run to ignore a given directory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions