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

Monkey-zef Permission denied error #9

Closed
melezhik opened this issue Jan 5, 2021 · 15 comments
Closed

Monkey-zef Permission denied error #9

melezhik opened this issue Jan 5, 2021 · 15 comments

Comments

@melezhik
Copy link
Contributor

melezhik commented Jan 5, 2021

ubuntu@ip-172-31-7-20:~$ s6 --plg-run raku-utils-fez@args=monkey-zef
04:05:15 01/05/2021 [task] :: run plg raku-utils-fez@args=monkey-zef
04:05:15 01/05/2021 [task] :: run thing raku-utils-fez
04:05:16 01/05/2021 [raku-utils-fez] :: stderr: ++ fez monkey-zef
04:05:17 01/05/2021 [raku-utils-fez] :: >>= i plan to patch: /opt/rakudo-pkg/share/perl6/core/resources/97D5F4F3187148F264031A570818A46964BAD1EC.json
04:05:17 01/05/2021 [raku-utils-fez] :: >>= zef-p6c: A mirror of the p6c ecosystem.
y
04:05:19 01/05/2021 [raku-utils-fez] :: >>= Add zef-p6c ecosystem? (y/n) >>= zef: This is where modules are uploaded by module authors using fez.
y
04:05:23 01/05/2021 [raku-utils-fez] :: stderr: Failed to open file /opt/rakudo-pkg/share/perl6/core/resources/97D5F4F3187148F264031A570818A46964BAD1EC.json: Permission denied
04:05:23 01/05/2021 [raku-utils-fez] :: stderr:   in sub MAIN at /home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib/sources/3EFFFDA5B58B3CD7CF91A57CDB9A973ACE70095E (Fez::CLI) line 56
  in block <unit> at /home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib/resources/71CE4220714A52039B29C0D6456EEBE
04:05:23 01/05/2021 [raku-utils-fez] :: stderr: 393061BC1 line 3
  in sub MAIN at /home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib/bin/fez line 3
  in block <unit> at /home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib/bin/fez line 1

04:05:23 01/05/2021 [raku-utils-fez] :: >>= Add zef ecosystem? (y/n)
04:05:23 01/05/2021 [raku-utils-fez] :: task exit status: 1
04:05:23 01/05/2021 [raku-utils-fez] :: task raku-utils-fez FAILED

HTH

@melezhik
Copy link
Contributor Author

melezhik commented Jan 5, 2021

ubuntu@ip-172-31-7-20:~$ s6 --plg-run raku-utils-fez
04:08:03 01/05/2021 [task] :: run plg raku-utils-fez
04:08:03 01/05/2021 [task] :: run thing raku-utils-fez
04:08:04 01/05/2021 [raku-utils-fez] :: stderr: ++ fez --help
04:08:05 01/05/2021 [raku-utils-fez] :: stderr:   Fez - Raku / Perl6 package utility

  USAGE

    fez command [args]

  COMMANDS

    register              registers you up
04:08:05 01/05/2021 [raku-utils-fez] :: stderr:  for a new account
    login                 logs you in and saves your key info
    upload                creates a distribution tarball and uploads
    monkey-zef            modifies your zef configuration for fez repos

  ENV OPTIONS

    FEZ_CONFIG
04:08:05 01/05/2021 [raku-utils-fez] :: stderr:         if you need to modify your config, set this env var

  CONFIGURATION (using: /home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib/resources/035C131EE8710DA4A882D87DAA2A174C3A255C94.json)

    Copy this to a cool location and write your own requestors/bundlers or
    ignore it and use the default curl/wget/git tools for great success.

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

Ahh - interesting. What is the output of zef --help ?

@melezhik
Copy link
Contributor Author

melezhik commented Jan 6, 2021

it's on my second comment

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

@melezhik zef, not fez - where does zef think its config is?

@melezhik
Copy link
Contributor Author

melezhik commented Jan 6, 2021

ah ... )))

ubuntu@ip-172-31-7-20:~$ zef --help
Zef - Raku / Perl6 Module Management

USAGE

    zef [flags|options] command [args]

    zef --version

COMMANDS

    install                 Install specific dependencies by name or path
    uninstall               Uninstall specified distributions
    test                    Run tests on a given module's path
    fetch                   Fetch and extract module's source
    build                   Run the Build.pm in a given module's path
    look                    Fetch followed by shelling into the module's path
    update                  Update package indexes for repositories
    upgrade (BETA)          Upgrade specific distributions (or all if no arguments)
    search                  Show a list of possible distribution candidates for the given terms
    info                    Show detailed distribution information
    browse                  Open browser to various support urls (homepage, bugtracker, source)
    list                    List known available distributions, or installed distributions with `--installed`
    depends                 List all direct and transitive dependencies for a given identity
    rdepends                List all distributions directly depending on a given identity
    locate                  Lookup installed module information by short-name, name-path, or sha1 (with --sha1 flag)
    smoke                   Run smoke testing on available modules
    nuke                    Delete directory/prefix containing matching configuration path or CURLI name

OPTIONS

    --install-to=[name]     Short name or spec of CompUnit::Repository to install to
    --config-path=[path]    Load a specific Zef config file
    --[phase]-timeout=[int] Set a timeout (in seconds) for the corresponding phase ( phase: fetch, extract, build, test, install )
    --[phase]-degree=[int]  Number of simultaneous distributions/jobs to process for the corresponding phase ( phase : fetch, test )

    --update                Force a refresh for all module indexes
    --update=[ecosystem]    Force a refresh for a specific ecosystem module index

    --/update               Skip refreshing all module indexes
    --/update=[ecosystem]   Skip refreshing for a specific ecosystem module index

ENV OPTIONS

    ZEF_[phase]_TIMEOUT     See --[phase]-timeout ( phases: FETCH, BUILD, TEST, INSTALL )
    ZEF_[phase]_DEGREE      See --[phase]-degree ( phases: FETCH, TEST )

VERBOSITY LEVEL (from least to most verbose)
    --error, --warn, --info (default), --verbose, --debug

FLAGS
    --deps-only             Install only the dependency chains of the requested distributions
    --dry                   Run all phases except the actual installations
    --serial                Install each dependency after passing testing and before building/testing the next dependency
    --contained (BETA)      Install all transitive and direct dependencies regardless if they are already installed globally

    --/test                 Skip the testing phase
    --/build                Skip the building phase

    --/depends              Do not fetch runtime dependencies
    --/test-depends         Do not fetch test dependencies
    --/build-depends        Do not fetch build dependencies

FORCE FLAGS
    Ignore errors occuring during the corresponding phase:
    --force-resolve --force-fetch --force-extract --force-build --force-test --force-install

CONFIGURATION /opt/rakudo-pkg/share/perl6/core/resources/97D5F4F3187148F264031A570818A46964BAD1EC.json
    Enable or disable plugins that match the configuration that has field `short-name` that matches <short-name>

    --<short-name>  # `--cpan`  Enable plugin with short-name `cpan`
    --/<short-name> # `--/cpan` Disable plugin with short-name `cpan`

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

Ah - definitely a permissions issue. I think I'm holding up merging a fix for this that @patrickbkr has put together. I'll review/get the fix out tomorrow.

@patrickbkr
Copy link
Collaborator

@tony-o The PR I created fixes permission errors when writing the fez config (adding username and token). It doesn't address changing the zef config. The zef documentation has a paragraph on how the right config file is chosen including how it locates the user config file. From what I read in those docs:

  • The quick and dirty solution is to just write to $*HOME/.zef/config.json
  • The clean solution is to scan zef --help for the config path, open that, extact the RootDir option and write to the file $RootDir/config.json.

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

gotcha. the way i'm doing it now is likely right. it just uses zef's method of %*ENV // guess-config-path. I've added a check for write permissions @melezhik - will push the fix today.

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

@melezhik #10 should give you a better error message, it can't fix the problem though. the actual problem being that the user you're running fez as doesn't have w permissions to the zef config file -

@melezhik
Copy link
Contributor Author

melezhik commented Jan 6, 2021

the error message is better now:

ubuntu@ip-172-31-56-130:~$ s6 --index-update
17:35:17 01/06/2021 [repository] :: update local index
17:35:17 01/06/2021 [repository] :: index updated from http://sparrowhub.io/repo/api/v1/index
ubuntu@ip-172-31-56-130:~$ s6 --search fez
17:35:52 01/06/2021 [repository] :: search plugins
raku-utils-fez ... Nil ... 0.0.3
ubuntu@ip-172-31-56-130:~$ s6 --plg-run raku-utils-fez@args="monkey-zef"
17:36:29 01/06/2021 [task] :: run plg raku-utils-fez@args=monkey-zef
17:36:29 01/06/2021 [task] :: run thing raku-utils-fez
17:36:29 01/06/2021 [repository] :: installing raku-utils-fez, version 0.000003
17:36:29 01/06/2021 [repository] :: install https://github.com/tony-o/raku-fez.git to /home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib
===> Installing: fez:ver<3>:auth<zef:tony-o>:api<0>

1 bin/ script [fez] installed to:
/home/ubuntu/sparrow6/plugins/raku-utils-fez/raku-lib/bin
17:36:40 01/06/2021 [raku-utils-fez] :: stderr: ++ fez monkey-zef
17:36:40 01/06/2021 [raku-utils-fez] :: >>= i plan to patch: /opt/rakudo-pkg/share/perl6/core/resources/0D8B1A93E0BF825E75397D9B2A7BA4C9AE0ABA46.json
17:36:40 01/06/2021 [raku-utils-fez] :: =<< config unwritable! quitting..
17:36:40 01/06/2021 [raku-utils-fez] :: task exit status: 255
17:36:40 01/06/2021 [raku-utils-fez] :: task raku-utils-fez FAILED

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

@melezhik you able to work with that? the way zef is set up is unlike what @patrickbkr did with fez's where they cascade, with zef it's all or nothing -

@melezhik
Copy link
Contributor Author

melezhik commented Jan 6, 2021

I mean I just inform what I get on my env. Do you think it's a fez's bug or it's just a very specific zef configuration that I have on my server and we could just ignore it?

@patrickbkr
Copy link
Collaborator

I just created an issue for zef to provide a way to change / add a single configuration value as that indeed seems to not be implemented.

@tony-o
Copy link
Owner

tony-o commented Jan 6, 2021

That may end up getting denied. Either way nick is interested in merging the zef p6c stuff so he doesn't have to manage that trash anymore and then this should become a moot issue

@tony-o
Copy link
Owner

tony-o commented Jan 12, 2021

Going to close this as a file permissions issue and not actually an issue with fez unless you object (please reopen if you do)

@tony-o tony-o closed this as completed Jan 12, 2021
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

3 participants