ices-tools-prod / icesSAG

R interface to Stock Assessment Graphs database web services
http://sg.ices.dk/webservices.aspx
9 stars 7 forks source link

token file ~/.Renviron_SG altered by calls to icesSAG functions #239

Open iagomosqueira opened 1 year ago

iagomosqueira commented 1 year ago

I have setup the .Renviron_SG file with a new token and issued

options(icesSAG.use_token = TRUE)

after I call findAssessmentKey('sol.27.4', year=ay, published = FALSE), the file is modified and is no longer valid.

Same happens with icesSAG::uploadStock(info, fishdata)

The SG_PAT= text disappears and the token is changed to a different one.

What could be causing this?

colinpmillar commented 1 year ago

I have no idea! thanks I will look into it asap

colinpmillar commented 1 year ago

@iagomosqueira , can you try running:

readRenviron(.sg_renviron)

and seeing if that changes the file? I am a bit at a loss no this one, maybe we need to have a quick teams chat to investigate.

iagomosqueira commented 1 year ago

Yes, it does change it. If I set the example token in the README, I get

b240a403-312b-4d46-810d-d90506ec7b95

after running readEnviron , but only the first time it is run in a session. So if I rewrite it back, it is not changed when readEnviron is called again in the same session.

colinpmillar commented 1 year ago

OK - well thats something... readEnviron is a base R function, so maybe there is a linux permissions issue going on? I would need to investigate on a linux machine or i'll catch you for a video chat at some point. A Curious one!