ministryofjustice / analytics-platform

Parent repository for the MOJ Analytics Platform
MIT License
14 stars 1 forks source link

Hibernations revealed a bug with s3tools #27

Closed RobinL closed 6 years ago

RobinL commented 6 years ago

What happened?

In the morning, I accessed the platform, and received the standard 'unidling' message.

I then tried to access data in s3 and got the following error:


09 Apr 2018 08:39:43 [rsession-robinl] ERROR session hadabend; LOGGED FROM: rstudio::core::Error {anonymous}::rInit(const rstudio::r::session::RInitInfo&) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:563

> s3tools::s3_path_to_df("alpha-everyone/iris.csv")
Error in UseMethod("s3_path_to_df", path) : 
  no applicable method for 's3_path_to_df' applied to an object of class "csv"

Running printenv in the terminal displays AWS_SESSION and AWS_ACCESS_KEY_ID as expected but shows AWS_CREDENTIAL_EXPIRATION=2018-04-03T08:25:13Z

I then run:

> s3tools::get_credentials()
<environment: 0x6375390>
attr(,"class")
[1] "refreshable_credentials"

but I still get AWS_CREDENTIAL_EXPIRATION=2018-04-03T08:25:13Z (I'm writing this on 9th April)

The only way to make it work again is to restart my R Studio in the control panel

I also periodically have got:

[2018-04-09 08:47:28] [error] handle_read_frame error: websocketpp.transport:7 (End of File)

And sometimes you get the 'setting default region' message as follows which you don't usually get

> s3tools::get_credentials()
Setting environment variable AWS_DEFAULT_REGION to 'eu-west-1'
<environment: 0x5ab8ef8>
attr(,"class")
[1] "refreshable_credentials"

Steps to reproduce the problem

Unidle the platform and attempt to access data

Expected behaviour

I expect that the iris dataset would be read into memory.

RobinL commented 6 years ago

This seems to be a bug with one of the methods in s3tools. I am in the process of fixing....

xoen commented 6 years ago

FYI: From conversation with @RobinL this doesn't seem to be caused by the hibernation. He thinks it's a quirk of R.

RobinL commented 6 years ago

Closing - addressing this here: https://github.com/moj-analytical-services/s3tools/issues/24