-
Notifications
You must be signed in to change notification settings - Fork 274
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
Reading errors after upgrade from 0.2.0 to 0.4.0 #271
Comments
Thanks for raising this. It would be helpful if you could also share the errors you are seeing, especially as this takes several hours to reproduce. |
Hi.
|
Ah sorry I misunderstood. Strange that you are seeing only the path with no Python traceback. You could try wrapping your whole |
That exactly what I did.
|
The exception message may just be that path but does the traceback show where it is being raised? import traceback
...
except Exception as e:
traceback.print_tb(e.__traceback__) |
Hi
|
Are you modifying the file on S3? Or is it just a static file? Could there be a chance that the file potentially doesn't exist for a brief amount of time? |
Nope, I am creating this file and read it after few minutes. |
Hmm ok. It appears that S3 is reporting the file doesn't exist which is raising the error. It's not exactly a solution but you could catch that error and retry? |
Duplicate of #253 ? @TomAugspurger , time to make dircache optional and off by default; or to introduce timed expiry? |
I am trying to execute this line of code before any S3 read, Hopefully it will help.
|
Yes to making it optional. I'm not sure about changing the default. It's hard to say what the right one is since it's workload dependent. |
Hi everyone. |
Thanks for coming back to let us know! |
I have a similar problem. In my case I'm doing a query to Athena. With s3fs = 0.2.0 I can do as many query as I want but with newer version I'm only getting a result for the first query and then I got def wait_for_query(athena_client, execution_id):
# TODO: add timeout
while True:
response = athena_client.get_query_execution(
QueryExecutionId=execution_id)
status = response['QueryExecution']['Status']['State']
if status in ['FAILED', 'CANCELLED']:
error = \
response['QueryExecution']['Status']['StateChangeReason']
raise Exception('Error doing query\n{}'.format(error))
elif status == 'SUCCEEDED':
break
sleep(2)
return response
def execute_athena_query(query, wait=True):
athena_client = boto3.client('athena', 'us-east-1')
athena_config = {
'OutputLocation': 's3://my_bucket/athena_results',
'EncryptionConfiguration': {'EncryptionOption': 'SSE_S3'}
}
athena_context = {'Database': 'my_database'}
response = athena_client.start_query_execution(
QueryString=query,
QueryExecutionContext=athena_context,
ResultConfiguration=athena_config)
execution_id = response['QueryExecutionId']
if wait:
response = wait_for_query(athena_client, execution_id)
return response
def get_df_athena(query, dtypes):
response = execute_athena_query(query)
location = response['QueryExecution']['ResultConfiguration']\
['OutputLocation']
df = pandas.read_csv(location, dtype=dtypes)
return df |
@TomAugspurger , revive the no-caching option? Or to try a direct HEAD in the case that a file appears unfound? |
I'm not sure, though it seems to be causing plenty of issues. To start with, I'd like to see a keyword |
Do you want me to help with this? |
If you're able to, that'd be great! |
Note that you can already set |
Hi
We are running Flask service on a docker image.
one of our main routes reads file from S3 and returns it's content.
recently we upgraded the package from version 0.2.0 to 0.4.0.
After the upgrade, the route is working fine, but after several hours it raises strange exceptions contains only the file path (without any other information)
Our temporary solution for that is to reset the container, after that it's working fine, but fails again after several hours.
The most strange thing is that when I am connecting to the same container (with the connection issues) and I am opening python shell and execute the code - It's working as expected, even when the flask service on the same container raise exceptions on the same file.
any ideas?
thanks
my code:
The text was updated successfully, but these errors were encountered: