International-Soil-Radiocarbon-Database / ISRaD

Repository for the development and release of ISRaD data and tools
https://international-soil-radiocarbon-database.github.io/ISRaD/
24 stars 15 forks source link

QA/QC not working from website #238

Closed jb388 closed 4 years ago

jb388 commented 4 years ago

Running QA/QC from the website now shows this error: "Github App international-soil-radiocarbon-database/ISRaD not installed on this server"

Maybe an opencpu issue? Not sure how the last updates to the repo could have caused this problem.

jb388 commented 4 years ago

FYI, QAQC function works fine directly from the R console. Again, points to opencpu as the culprit.

jb388 commented 4 years ago

OK, looks like opencpu pushed a new update on 3 July 2020, so that seems likely to be the cause. Will look into this further in the near future. Hopefully a simple fix.

kjmcfarlane commented 4 years ago

In the meantime, can you point me to the R script?

coreylawrence commented 4 years ago

Hi Karis,

If you install the ISRaD R package as follows (note that you will need to first install 'devtools' if you haven't already): devtools::install_github("International-Soil-Radiocarbon-Database/ISRaD", ref="master", force=TRUE) library(ISRaD)

You can run the QAQC report function using: QAQC("filename", writeQCreport=F)

If you'd like to save a .txt copy of the report output, you can use writeQCreport=T . However, you will need to manually create a folder named "QAQC" in the same directory where the file is located - otherwise it will spit back an error message.

Cheers, Corey

SophievF commented 4 years ago

Hi everyone, You can also use the compile function if you would like to run QAQC for more then one template at the same time:

compile(dataset_directory = "YourDirectory", write_report = T, write_out = T, return = "list")

You have to make sure that all the templates you want to check/compile are in "YourDirectory" folder and the function creates a QAQC folder with the reports within the same folder.

SophievF commented 4 years ago

Note: the QAQC function itself (when directly called as Corey it describes) is checking for the doi and may tell you that the doi is not valid (even though it is correct). Within the compile function check doi is set to FALSE by default.

jb388 commented 4 years ago

Just to chime in: as @SophievF says, when you run "compile.R" the DOI check functionality of the internal QAQC call is suppressed. This is a known issue with the way that the DOI check works. Unfortunately, when the DOI check queries the online server to validate the DOI, it is not uncommon for the request to time out, which can result in an erroneous "DOI not valid" response.

This is the reason that the compile function does not check the validity of DOIs---because beyond a certain number of entries it is almost inevitable that some of the DOI check requests will time out, which will then abort the compilation process.

I would recommend still running QAQC as a standalone function for each entry that needs to be checked. An alternative to batching this process would be to embed the QAQC function in a for loop.

bpbond commented 4 years ago

Hi @jb388 happy to do something if I can help, but not sure why this was just assigned to me. Thanks!

jb388 commented 4 years ago

Hi @jb388 happy to do something if I can help, but not sure why this was just assigned to me. Thanks!

@bpbond Sorry---no pressure, we just keep running into dead ends with this issue even though it seems like it should be a simple fix. I thought there was a chance you may be more familiar with this sort of thing.

bpbond commented 4 years ago

I don't offhand, sorry, though got interested looking through Rpkg/inst/www just now. Is there documentation or an URL for this functionality?

jb388 commented 4 years ago

I don't offhand, sorry, though got interested looking through Rpkg/inst/www just now. Is there documentation or an URL for this functionality?

We've been using the opencpu package to host ISRaD on a remote server and run the QA/QC script via html (so users don't have to have R installed to run QA/QC on an entry). Here's the opencpu manual. This was setup by our original maintainer @greymonroe who has since left the project. It was a simple and elegant solution, but unfortunately it appears to have been broken somehow in the latest opencpu update. The key issue seems to be that we have our R pkg in a subdirectory, rather than in the top level directory of the repo.

Again, don't feel obligated to spend time on this, I assigned you on the outside chance you were familiar with this sort of thing. So no worries.

jb388 commented 4 years ago

Oh, just to note that I moved the Rpkg to the sub directory 9 months ago, but the issue only cropped up about a week ago, coinciding with a new release of the opencpu package on July 3rd. That said, I couldn't easily identify anything in their latest commits that seem to relate to our specific issue.

jb388 commented 4 years ago

Thanks to @ShaneStoner, we fixed the issue. We are know running QA/QC as a shiny app. This has the additional benefit of providing a basic platform for all the shiny functionality we've talked about rebooting over the years.