afsc-assessments / afscdata

An R package for data extraction of AFSC survey and fishery data
https://afsc-assessments.github.io/afscdata/
Other
2 stars 0 forks source link

Can't pull BSAI flathead sole data #48

Closed Lee-Cronin-Fine-NOAA closed 1 week ago

Lee-Cronin-Fine-NOAA commented 2 months ago

I can't get afscdata::bsai_fhs function to run. I get the following error.

" Error in UseMethod("tbl") : no applicable method for 'tbl' applied to an object of class "Oracle" "

I tried to diagnose the issue and the error occurs with the functions q_catch and q_fish_obs are called.

BenWilliams-NOAA commented 2 months ago

try remotes::install_github("afsc-assessments/afscdata", force = TRUE) I just ran it and it worked fine - though took a long time, likely due to my awful, slow internet today

mkapur-noaa commented 2 months ago

I troubleshooted this with @Lee-Cronin-Fine-NOAA yesterday and we were able to sort it; this is an issue that might come up for other stocks as well. For deep IT reasons I don't completely understand, the connect() function upon which the queries rely is dependent on R package 'ODBC' ver 1.3.5. Users with more recent versions (1.4.0+) will receive an error about "slots" or simply that the table is not of the right format (because it never downloaded). There is a note regarding this in the BSAI FHS 2024 script.

The correct version of ODBC can be downloaded from the archive website here.

Users should also be cautious not to "update all" dependencies when re-installing packages, since this will overwrite ODBC, and/or we could consider a version dependency for odbc for afsc-data. This issue for BSAI-FHS can be closed

BenWilliams-NOAA commented 2 months ago

Cool, thanks for following up @mkapur-noaa, also worth noting what Matt Callahan sent along to the R-users group (below) - wonder if it is related? I haven't updated my R since I'm in the weeds on a number of things right now and don't have time for a blow up. Will report back with hopefully a package fix when I update.

So the new version of R caused me to be unable to install packages from github (I had happily ignored the long ongoing saga that many of you sorted out ages ago). I do not have a github enterprise license and so the sso steps seemed to be a dead end. I also tried Kathryn's CURL_SSL_BACKGROUND write from March 25, but that did not work either. I solved it by reading through a bunch of confusing (to me) tutorials with long link trees so I thought I would post my solution here in case it helps someone. No guarantees this will work for anyone else, I am on a PSMFC laptop so maybe not even relevant to others, but here goes: Open Git Bash. Paste the text below, replacing the email used in the example with your GitHub email address.

ssh-keygen -t ed25519 -C "YOUR.NAME@noaa.gov"

Press enter to accept the default location Press y if prompted to overwrite an existing key. Press enter twice for no passphrase. Go to github account on the web, then settings>SSH & GPG keys Click new SSH key Name the key “noaa_laptop” or something, keep key type as ‘authentication’ Open the key file from C:/users/YOU/.ssh/id_ed25519 in notepad and paste contents of the file as the key. Click save Restart Rstudio and successfully install packages from github.

mkapur-noaa commented 2 months ago

Huh, I wasn't aware of this thread and that sounds like a yikes. I know Carey had some github install issues last week but it was sorted fairly painlessly via creation of a PAT (see chat in SMART space). Agree that caution is worth it before going ahead with an update.

BenWilliams-NOAA commented 1 week ago

believe this is addressed so closing, will reopen if not