AtlasOfLivingAustralia / ALA4R

Access data and resources hosted by the Atlas of Living Australia (ALA)
https://atlasoflivingaustralia.github.io/ALA4R/
41 stars 8 forks source link

problem accessing records using occurrences() #53

Open terraignisaura opened 5 years ago

terraignisaura commented 5 years ago

On running the following R code, i receive an error that includes a HTTP "301 Moved" server error. I first received on 12/03/2019. I was using the same code on 11/03/2019 with no issue. I assume some server changes or updates are causing this.

query <- sprintf("taxon_name:\"%s\"", species) temp <- occurrences(taxon=query,download_reason_id=4, use_data_table=TRUE) Error in parse_con(txt, bigint_as_char) : lexical error: invalid char in json text.

301 Moved (right here) ------^ </blockquote> <p>do you require more detail?</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/terraignisaura"><img src="https://avatars.githubusercontent.com/u/37893448?v=4" />terraignisaura</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I have temporarily created a workaround at my end, but hoping a solution is found soon given how extremely useful this library is.</p> <p>Regards</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/meridyp"><img src="https://avatars.githubusercontent.com/u/46877403?v=4" />meridyp</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I am having the same issue with this code</p> <p>d <- data.frame(ala_fields("layers"))</p> <p>Receiving the same error message. Would you mind sharing your workaround? Thank you</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/raymondben"><img src="https://avatars.githubusercontent.com/u/6445827?v=4" />raymondben</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I am no longer maintaining ALA4R so this isn't an official reply (!) but the issue appears to be that the servers have changed to secure <code>https://...</code>. So when ALA4R sends its queries via <code>http://...</code> they are being redirected at the server end to the secure address, but ALA4R isn't following the redirection. One possible workaround would be to:</p> <ul> <li>clone the ALA4R repository to your local computer</li> <li>edit the <code>R/onload.R</code> script, changing the relevant <code>http://...</code> entries to <code>https://...</code></li> <li>use <code>devtools::load_all</code> to load the package, rather than <code>library(ALA4R)</code></li> </ul> <p>That is admittedly rather a complicated workaround so hopefully the maintainers can confirm my diagnosis and fix the issue soon. I would do it but I am not sure if <em>all</em> endpoints have changed to <code>https</code>, or only some, so I might end up breaking more than I fix ...</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/meridyp"><img src="https://avatars.githubusercontent.com/u/46877403?v=4" />meridyp</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>Thanks very much Ben, I will give that a go!</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/peggynewman"><img src="https://avatars.githubusercontent.com/u/1271932?v=4" />peggynewman</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>Cheers Ben, and thanks for raising the issue all. There were some changes especially to the spatial services, and Ben is right about the https. I'm running some testing on all of the endpoints now and I'll get a new version up as soon as I can.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/peggynewman"><img src="https://avatars.githubusercontent.com/u/1271932?v=4" />peggynewman</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>Hi all, I've updated ALA4R with quite a big change to remove the dependency on the older RCurl library in the backend, and now use httr. The tests all now run successfully and the new builds (1.7.0) are working their way through CRAN. So you can install from the github master now, or wait another few days for the installation to come through CRAN. </p> <p>The ALA tightened security on everything to a minimum of TLS1.2 which meant that machines using older security protocols got locked out. httr works around this problem.</p> <p>Thanks very much for reporting the issue. Let me know if anything comes up for you in the new version.</p> <p>Cheers Peggy</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>