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

FileExistsError during second cylc install with --directory option #4322

Closed
MetRonnie opened this issue Jul 23, 2021 · 0 comments · Fixed by #4338
Closed

FileExistsError during second cylc install with --directory option #4322

MetRonnie opened this issue Jul 23, 2021 · 0 comments · Fixed by #4338
Assignees
Labels
bug Something is wrong :(
Milestone

Comments

@MetRonnie
Copy link
Member

MetRonnie commented Jul 23, 2021

Describe the bug

I get traceback when doing a second cylc install due to a problem with how the _cylc-install/source symlink is handled.

Release version(s) and/or repository branch(es) affected?

master

Steps to reproduce the bug

  1. Install a workflow, e.g. the cylc-doc forecasting workflow

    $ cd ~/github/cylc-doc
    $ cylc install -C cylc/doc/etc/tutorial/cylc-forecasting-workflow/
    INSTALLED cylc-forecasting-workflow/run1 from cylc/doc/etc/tutorial/cylc-forecasting-workflow
  2. (Optional - run the workflow, which is what I did but probably isn't needed to reproduce)

  3. Install the second run, and get FileExistsError

    $ cylc install -C cylc/doc/etc/tutorial/cylc-forecasting-workflow/
    Traceback (most recent call last):
    File "~/miniconda3/envs/cylc8/bin/cylc", line 33, in <module>
        sys.exit(load_entry_point('cylc-flow', 'console_scripts', 'cylc')())
    File "~/github/cylc-flow/cylc/flow/scripts/cylc.py", line 538, in main
        execute_cmd(command, *cmd_args)
    File "~/github/cylc-flow/cylc/flow/scripts/cylc.py", line 174, in execute_cmd
        COMMANDS[cmd].resolve()(*args)
    File "~/github/cylc-flow/cylc/flow/terminal.py", line 260, in wrapper
        wrapped_function(*wrapped_args, **wrapped_kwargs)
    File "~/github/cylc-flow/cylc/flow/scripts/install.py", line 187, in main
        install(parser, opts, reg)
    File "~/github/cylc-flow/cylc/flow/scripts/install.py", line 232, in install
        cli_symlink_dirs=cli_symdirs
    File "~/github/cylc-flow/cylc/flow/workflow_files.py", line 1354, in install_workflow
        source_link.symlink_to(source)
    File "~/miniconda3/envs/cylc8/lib/python3.7/pathlib.py", line 1309, in symlink_to
        self._accessor.symlink(target, self, target_is_directory)
    File "~/miniconda3/envs/cylc8/lib/python3.7/pathlib.py", line 418, in symlink
        return os.symlink(a, b)
    FileExistsError: [Errno 17] File exists: 'cylc/doc/etc/tutorial/cylc-forecasting-workflow' -> '~/cylc-run/cylc-forecasting-workflow/_cylc-install/source'

Additional context

The source symlink is broken (and was already broken after the first install)

$ readlink ~/cylc-run/cylc-forecasting-workflow/_cylc-install/source
cylc/doc/etc/tutorial/cylc-forecasting-workflow

Looks like the relative path needs to be expanded to an absolute one, but this might be a slightly separate problem to the main issue?

Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read CONTRIBUTING.md before starting any work though).

@datamel I'm happy to have a go at fixing this myself, but can I ask you to try and reproduce?

@MetRonnie MetRonnie added the bug Something is wrong :( label Jul 23, 2021
@MetRonnie MetRonnie changed the title FileExistsError during second cylc install FileExistsError during second cylc install with --directory option Jul 23, 2021
@MetRonnie MetRonnie added this to the cylc-8.0b3 milestone Jul 23, 2021
@datamel datamel mentioned this issue Aug 2, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants