FileNotFoundError on file.read
See original GitHub issueI have uploaded a file to GCS and was able to read it without problem. After that I deleted the file and uploaded it again with a same name. When I called file.read function again, I receive FileNotFoundError coming from fetch range though the file exists. Full traceback:
byte_str = csv_file.read(4096)
File "/opt/conda/default/lib/python3.6/site-packages/fsspec/spec.py", line 1040, in read
out = self.cache._fetch(self.loc, self.loc + length)
File "/opt/conda/default/lib/python3.6/site-packages/fsspec/core.py", line 464, in _fetch
self.cache = self.fetcher(start, end + self.blocksize)
File "</opt/conda/default/lib/python3.6/site-packages/decorator.py:decorator-gen-22>", line 2, in _fetch_range
File "/opt/conda/default/lib/python3.6/site-packages/gcsfs/core.py", line 54, in _tracemethod
return f(self, *args, **kwargs)
File "/opt/conda/default/lib/python3.6/site-packages/gcsfs/core.py", line 1067, in _fetch_range
headers=head)
File "</opt/conda/default/lib/python3.6/site-packages/decorator.py:decorator-gen-2>", line 2, in _call
File "/opt/conda/default/lib/python3.6/site-packages/gcsfs/core.py", line 54, in _tracemethod
return f(self, *args, **kwargs)
File "/opt/conda/default/lib/python3.6/site-packages/gcsfs/core.py", line 462, in _call
validate_response(r, path)
File "/opt/conda/default/lib/python3.6/site-packages/gcsfs/core.py", line 157, in validate_response
raise FileNotFoundError
FileNotFoundError
I have invalided the cache and cleared instance cache before reading the file but they didn’t help.
Versions: gcsfs==0.3.0 dask==2.1.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:17 (9 by maintainers)
Top Results From Across the Web
python - Why am I getting a FileNotFoundError? - Stack Overflow
Closed 5 months ago. I'm trying to write a simple program to read a file and search for a word then print how...
Read more >Python FileNotFoundError: [Errno 2] No such file or directory ...
This error is usually raised when you use the os library. You will see an IOError if you try to read or write...
Read more >FileNotFoundError: [Errno 2] No such file or directory
The Python "FileNotFoundError: [Errno 2] No such file or directory" occurs when we try to open a file that doesn't exist in the...
Read more >[SOLVED] Python filenotfounderror - A Quick Guide - AskPython
It is a system message that the compiler throws when you are trying to execute a command that requires a file that the...
Read more >FileNotFoundError: [Errno 2] No such ... - Net-Informations.Com
No such file or directory" is telling you that there is no file of that name in the working directory. So, try using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that it’s a cache issue like you suggested above:
To my knowledge, GCS provides strong consistency for read-after-write
https://cloud.google.com/storage/docs/consistency#strongly_consistent_operations
I’m running into read-after-write issues implementing GCS in https://github.com/rstudio/pins-python, that I don’t see with the S3 filesystem, so can dig into this a bit!