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

OSError: [Errno 17] File exists #20

Closed
tseemann opened this issue Sep 15, 2016 · 12 comments
Closed

OSError: [Errno 17] File exists #20

tseemann opened this issue Sep 15, 2016 · 12 comments
Assignees
Labels
Milestone

Comments

@tseemann
Copy link

Been getting this a bit when I restart jobs that failed due to unreachable network:

NFO: Starting new HTTPS connection (1): ftp.ncbi.nlm.nih.gov
DEBUG: "GET /genomes/all/GCA_001443705.1_ASM144370v1/GCA_001443705.1_ASM144370v1_genomic.gbff.gz HTTP/1.1" 200 185238057
Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/bin/ncbi-genome-download", line 11, in <module>
    sys.exit(main())
  File "/home/linuxbrew/.linuxbrew/Cellar/python/2.7.12_1/lib/python2.7/site-packages/ncbi_genome_download/__main__.py", line 78, in main
INFO: Starting new HTTPS connection (1): ftp.ncbi.nlm.nih.gov
    ret = ncbi_genome_download.download(args)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/2.7.12_1/lib/python2.7/site-packages/ncbi_genome_download/core.py", line 60, in download
    args.taxid, args.human_readable, args.parallel)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/2.7.12_1/lib/python2.7/site-packages/ncbi_genome_download/core.py", line 94, in _download
    pool.map(worker, download_jobs)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/2.7.12_1/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/home/linuxbrew/.linuxbrew/Cellar/python/2.7.12_1/lib/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
OSError: [Errno 17] File exists
@kblin
Copy link
Owner

kblin commented Sep 15, 2016

Hm, I wonder if that's while creating the link. Is this a call with --human-readable?

@kblin kblin added the bug label Sep 15, 2016
@kblin kblin self-assigned this Sep 15, 2016
@tseemann
Copy link
Author

Yes, I am using ncbi-genome-download --debug -v -o fungi -H -p 1 -s genbank -r 2 -F genbank fungi

@kblin
Copy link
Owner

kblin commented Sep 16, 2016

I think this is the link creation logic for --human-readable, that probably needs to check if the link already exists.

@anphung
Copy link
Contributor

anphung commented Dec 22, 2016

@tseemann Would help if you provide ncbi-genome-download version as well as how to reproduce the bug.
@kblin Haven't we already passed all errno.EEXIST?

@kblin
Copy link
Owner

kblin commented Dec 22, 2016

This still exists in latest master. The problem is that we're not checking if the symlink exists already in
download_and_check. See https://github.com/kblin/ncbi-genome-download/blob/master/ncbi_genome_download/core.py#L289

@anphung
Copy link
Contributor

anphung commented Dec 22, 2016

I see. So we should overwrite it with the new source?

@kblin
Copy link
Owner

kblin commented Dec 22, 2016

We could check if it points at the same target as the one we want to create, and leave the link alone if it does or remove and recreate otherwise.

@anphung
Copy link
Contributor

anphung commented Dec 22, 2016

Since we would link it to the same target whether it points to the target or not, how about we just unlink and link it to the target in both case?

@kblin
Copy link
Owner

kblin commented Dec 22, 2016

I guess that would work as well.

@anphung
Copy link
Contributor

anphung commented Dec 22, 2016

Thanks, please have a look at the PR.

@kblin kblin closed this as completed in b617e6e Dec 23, 2016
@kblin kblin added this to the 0.2.3 release milestone Feb 8, 2017
@kblin
Copy link
Owner

kblin commented Feb 8, 2017

Reopening issues that aren't shipped in a release yet.

@kblin kblin reopened this Feb 8, 2017
@kblin
Copy link
Owner

kblin commented Feb 8, 2017

Shipped in 0.2.3 release

@kblin kblin closed this as completed Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants