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

macOS download_dir does not exist or is not writable, unless in verbose mode #411

Closed
phyordia opened this issue Nov 1, 2020 · 4 comments · Fixed by #548
Closed

macOS download_dir does not exist or is not writable, unless in verbose mode #411

phyordia opened this issue Nov 1, 2020 · 4 comments · Fixed by #548
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type

Comments

@phyordia
Copy link

phyordia commented Nov 1, 2020

Hi all,

I have constructor 3.1.0 from conda install -y ctools/label/dev::constructor
and when I try to create a new installer from the environment, I get the following error:

❯❯❯ constructor --cache-dir cache --output-dir dist .                                                                                                                           
platform: osx-64
Traceback (most recent call last):
  File "/Users/user/miniconda3/envs/test/bin/constructor", line 11, in <module>
    sys.exit(main())
  File "/Users/user/miniconda3/envs/test/lib/python3.8/site-packages/constructor/main.py", line 243, in main
    main_build(dir_path, output_dir=out_dir, platform=args.platform,
  File "/Users/user/miniconda3/envs/test/lib/python3.8/site-packages/constructor/main.py", line 111, in main_build
    fcp_main(info, verbose=verbose, dry_run=dry_run, conda_exe=conda_exe)
  File "/Users/user/miniconda3/envs/test/lib/python3.8/site-packages/constructor/fcp.py", line 383, in main
    _urls, dists, approx_tarballs_size, approx_pkgs_size, has_conda = _main(
  File "/Users/user/miniconda3/envs/test/lib/python3.8/site-packages/constructor/fcp.py", line 309, in _main
    pc_recs = _fetch(download_dir, precs)
  File "/Users/user/miniconda3/envs/test/lib/python3.8/site-packages/constructor/fcp.py", line 110, in _fetch
    assert pc.is_writable, download_dir + " does not exist or is not writable"
AssertionError: [---redacted---]/cache/osx-64 does not exist or is not writable

However, if I run it with the -v option, it does run successfully 😮

I noticed that the setuid bit is set when using -v, but not otherwise.

❯❯❯ constructor -v --cache-dir cache --output-dir dist .
[...]

❯❯❯ ls -lha | grep cache
drwxrwsr-x   3 user  1244544504    96B Oct 31 21:24 cache

❯❯❯ rm -rf cache                                                                                                                                                             

❯❯❯ constructor --cache-dir cache --output-dir dist .
[...Error above...]

❯❯❯ ls -lha | grep cache
drwxr-x---   3 user  1244544504    96B Oct 31 21:24 cache

Any clues?

How to reproduce:
Install miniconda

./Miniconda3-latest-MacOSX-x86_64.sh

Welcome to Miniconda3 py38_4.8.3
...

open a new session:

❯❯❯  conda -V
conda 4.8.3

❯❯❯ conda create -y -n myenv python=3.8.5
❯❯❯ conda activate myenv
❯❯❯ conda install -y ctools/label/dev::constructor
❯❯❯ cat construct.yaml                                                                                                                                                      
name: test_installer
version: 1.0.0

channels:
  - http://repo.anaconda.com/pkgs/main/
  - https://repo.anaconda.com/pkgs/main/osx-64  [osx]
  - https://repo.anaconda.com/pkgs/main/noarch

environment: myenv

Thanks in advance.

@mcg1969 mcg1969 added the type::bug describes erroneous operation, use severity::* to classify the type label Nov 14, 2020
@mcg1969
Copy link
Contributor

mcg1969 commented Nov 14, 2020

Wow, that's an interesting bug. Thank you for the report! We will certainly need to take a look at this.

@hoechenberger
Copy link
Contributor

I just ran into this same issue with the latest release of the constructor on Linux. Just chiming in to say that it's not just a macOS issue.

@jaimergp
Copy link
Contributor

It looks like the only non-print-to-stdout call that verbose is directly responsible for in constructor is this function to check for outdated records. Interestinhglhy, this relies on SubdirData.query_all(), which features a create_cache_dir() call :)

That function delegates the creation of the directory to another one, which makes sure the permission bits are correctly set.

@phyordia
Copy link
Author

unfortunately it doesnt fix the bug. Please see #548 (comment)

@phyordia phyordia mentioned this issue Aug 16, 2022
3 tasks
@jaimergp jaimergp moved this to Done in 🧭 Planning Aug 22, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants