Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Error importing DwC file from URL #20

Closed
Daphnisd opened this issue Jul 18, 2017 · 20 comments
Closed

Error importing DwC file from URL #20

Daphnisd opened this issue Jul 18, 2017 · 20 comments
Labels

Comments

@Daphnisd
Copy link

Daphnisd commented Jul 18, 2017

> devtools::session_info() Session info ------------------------------------------------------------------------------------------------------------  setting  value                         version  R version 3.4.1 (2017-06-30)  system   x86_64, mingw32               ui       RStudio (1.0.143)             language (EN)                          collate  English_United States.1252    tz       Europe/Paris                  date     2017-07-18                    Packages ----------------------------------------------------------------------------------------------------------------  package    * version date       source          base       * 3.4.1   2017-06-30 local           compiler     3.4.1   2017-06-30 local           data.table   1.10.4  2017-02-01 CRAN (R 3.4.0)  datasets   * 3.4.1   2017-06-30 local           devtools   * 1.13.2  2017-06-02 CRAN (R 3.4.1)  digest       0.6.12  2017-01-27 CRAN (R 3.4.1)  EML          1.0.3   2017-05-01 CRAN (R 3.4.1)  finch      * 0.1.0   2016-12-23 CRAN (R 3.4.1)  graphics   * 3.4.1   2017-06-30 local           grDevices  * 3.4.1   2017-06-30 local           memoise      1.1.0   2017-04-21 CRAN (R 3.4.1)  methods    * 3.4.1   2017-06-30 local           plyr         1.8.4   2016-06-08 CRAN (R 3.4.1)  rappdirs     0.3.1   2016-03-28 CRAN (R 3.4.1)  Rcpp         0.12.12 2017-07-15 CRAN (R 3.4.1)  stats      * 3.4.1   2017-06-30 local           tools        3.4.1   2017-06-30 local           utils      * 3.4.1   2017-06-30 local           uuid         0.1-2   2015-07-28 CRAN (R 3.4.0)  withr        1.0.2   2016-06-20 CRAN (R 3.4.1)  xml2         1.1.1   2017-01-24 CRAN (R 3.4.1)
--

I get the following error:

file <- "http://ipt.vliz.be/eurobis/archive.do?r=nbn_ga000467&v=1.1"
out <- dwca_read(file, read = TRUE)
File in cache
Error in if (grepl("<|>", x)) { : argument is of length zero

but the following works fine:

file <- "dwca-nbn_ga000467-v1.1.zip"
out <- dwca_read(file, read = TRUE)

@sckott sckott added the bug label Jul 18, 2017
@sckott
Copy link
Contributor

sckott commented Jul 18, 2017

Thanks for the report @Daphnisd - I'll have a look

@sckott
Copy link
Contributor

sckott commented Jul 18, 2017

I think its an issue that was fixed in #17 - try reinstall from github devtools::install_github("ropensci/finch") , restart R session, then try again

@Daphnisd
Copy link
Author

Daphnisd commented Jul 19, 2017

installing from devtools and restarting R did not resolve the issue.
I still have:

file <- "http://ipt.vliz.be/eurobis/archive.do?r=nbn_ga000467&v=1.1" >
out <- dwca_read(file, read = TRUE)
File in cache Error in if (grepl("<|>", x)) { : argument is of length zero

> devtools::session_info() Session info ------------------------------------------------------------------------------------------------------------  setting  value                         version  R version 3.4.1 (2017-06-30)  system   x86_64, mingw32               ui       RStudio (1.0.143)             language (EN)                          collate  English_United States.1252    tz       Europe/Paris                  date     2017-07-19                    Packages ----------------------------------------------------------------------------------------------------------------  package    * version    date       source                           base       * 3.4.1      2017-06-30 local                            compiler     3.4.1      2017-06-30 local                            data.table   1.10.4     2017-02-01 CRAN (R 3.4.0)                   datasets   * 3.4.1      2017-06-30 local                            devtools     1.13.2     2017-06-02 CRAN (R 3.4.1)                   digest       0.6.12     2017-01-27 CRAN (R 3.4.1)                   EML          1.0.3      2017-05-01 CRAN (R 3.4.1)                   finch      * 0.1.0.9000 2017-07-19 Github (ropensci/finch@d7db645)  graphics   * 3.4.1      2017-06-30 local                            grDevices  * 3.4.1      2017-06-30 local                            memoise      1.1.0      2017-04-21 CRAN (R 3.4.1)                   methods    * 3.4.1      2017-06-30 local                            plyr         1.8.4      2016-06-08 CRAN (R 3.4.1)                   rappdirs     0.3.1      2016-03-28 CRAN (R 3.4.1)                   Rcpp         0.12.12    2017-07-15 CRAN (R 3.4.1)                   stats      * 3.4.1      2017-06-30 local                            tools        3.4.1      2017-06-30 local                            utils      * 3.4.1      2017-06-30 local                            uuid         0.1-2      2015-07-28 CRAN (R 3.4.0)                   withr        1.0.2      2016-06-20 CRAN (R 3.4.1)                   xml2         1.1.1      2017-01-24 CRAN (R 3.4.1)
--

@sckott
Copy link
Contributor

sckott commented Jul 21, 2017

@Daphnisd okay, will have another look at it

@sckott
Copy link
Contributor

sckott commented Jul 21, 2017

@Daphnisd can you run that again and then run traceback() after that error happens and paste in those error messages

@Daphnisd
Copy link
Author

file <- "http://ipt.vliz.be/eurobis/archive.do?r=nbn_ga000467&v=1.1"
out <- dwca_read(file, read = TRUE)
File in cache
Error in if (grepl("<|>", x)) { : argument is of length zero
traceback()
5: read_xml.character(grep("meta.xml", x, value = TRUE))
4: read_xml(grep("meta.xml", x, value = TRUE))
3: data_paths(ff)
2: parse_dwca(x)
1: dwca_read(file, read = TRUE)
--

@sckott
Copy link
Contributor

sckott commented Jul 24, 2017

thx. interesting, it's an error in xml2. will look into that

@sckott
Copy link
Contributor

sckott commented Aug 16, 2017

@Daphnisd Just ran this on a windows VM with same R version and I think same Windows OS version and I can't replicate your error.

I don't think it's an xml2 problem since we have the same version.

Can you start with a fresh R session, make sure you have finch v0.1.0.9000 installed by doing packgeVersion("finch") then try your eg again - do you get the same error and if so, do traceback again

@Daphnisd
Copy link
Author

Daphnisd commented Aug 17, 2017

My colleague who has the same system just installed R and does not encounter an issue running the code. However, reinstalling R, and R studio (while deleting all directories) does not solve it on my system (I tried 3 times,...) . You know how I can do a clean reinstall?

@sckott
Copy link
Contributor

sckott commented Aug 18, 2017

@Daphnisd since it may be an xml2 package problem can you install that package, though it may already be installed, load it, and try to run examples from xml2::read_xml

@Daphnisd
Copy link
Author

I have no issue running any of the examples.

@sckott
Copy link
Contributor

sckott commented Aug 23, 2017

@Daphnisd okay, thanks

@albenson-usgs
Copy link

@Daphnisd Were you able to get this error resolved? I'm running into it myself.

@Daphnisd
Copy link
Author

Daphnisd commented Sep 21, 2017

No, I still have the error, as does a colleague of mine. But another colleague who has the same system which installed R for the first time and did not encounter any issues. I should check on a clean computer which additional R package or other software makes it break.

@pieterprovoost
Copy link

I have this issue intermittently on mac, and am able to solve it by clearing the file cache:

dwca_cache_delete_all(force = TRUE)

@albenson-usgs
Copy link

Yep, that fixed it. Thanks @pieterprovoost

@sckott
Copy link
Contributor

sckott commented Sep 21, 2017

thanks @pieterprovoost for the help here - will look into cache interference here

@Daphnisd
Copy link
Author

Indeed that fixed it here too. Thnx!

@sckott
Copy link
Contributor

sckott commented Sep 22, 2017

if okay with you i want to keep this open to look if there's anything I can fix in the pkg so this problem can be avoided in the future

@sckott sckott reopened this Sep 22, 2017
@sckott
Copy link
Contributor

sckott commented Nov 14, 2017

closing for now, if it comes up again i can can re-open

@sckott sckott closed this as completed Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants