Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with sf library in R and udunits on deploy #566

Open
jebyrnes opened this issue Jan 12, 2024 · 9 comments
Open

problem with sf library in R and udunits on deploy #566

jebyrnes opened this issue Jan 12, 2024 · 9 comments
Assignees

Comments

@jebyrnes
Copy link

I'm trying to build a new lesson. It compiles and looks great locally, and the pages build.... but, anything using the R sf library fails, with the following error.

Error: package or namespace load failed for 'sf' in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/runner/.local/share/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu/units/0.8-5/119d19da480e873f72241ff6962ffd83/units/libs/units.so':
  libudunits2.so.0: cannot open shared object file: No such file or directory

I've looked through the files for the r-ras lesson, but cannot find where it would enable udunits being installed. What do I need to include and where to fix this.....

@jebyrnes
Copy link
Author

@froggleston
Copy link
Contributor

Hi @jebyrnes !

This sounds like one of the dependencies of the SF package itself isn't fulfilled on your system. Could you try installing the required dependencies of sf (specifically in this case udunits2) as per the instructions in this SO post?

https://stackoverflow.com/questions/61234169/how-to-solve-error-libudunits2-a-not-found-when-installing-udunits2-in-r-3

Please let me know if you need any more assistance!

@jebyrnes
Copy link
Author

This is actually ON github. It works just fine on my system. I can run sandpaper::build_lesson() locally, and everything is good. But when I push to github, I get the errors during the site build.

@froggleston
Copy link
Contributor

Ah I see! Apologies, and thanks for the clarification. I'll try to dig into this over the next few days.

@froggleston
Copy link
Contributor

froggleston commented Jan 17, 2024

I've been digging around in the action output from your repo, and found an issue with the step that retrieves dependencies for the specific R packages you use: https://github.com/cobalt-casco/r-shiny-geospatial/actions/runs/7535424481/job/20511384858#step:6:252

I'm afraid I'm as yet unaware of where these dependencies are generated from, and I can't see a similar output in the DC r-raster-geospatial lesson for example (which uses a lot of the same dependencies you're pulling in).

I'm guessing a typo somewhere, but am finding it tricky to discover where!

Update: It looks like it's the chromote package, but still digging! My suggestion would be that you remove that dependency from your renv.lock if it's not required, and try again? It seems webshot2 depends on chromote, so you might get away with only specifying the webshot2 dep and not the additional chromote? Just a thought!

@froggleston
Copy link
Contributor

Final thought - you might need to specify an action to set up chrome specifically for GHA: https://github.com/browser-actions/setup-chrome

@jebyrnes
Copy link
Author

Huh - will look. FYI, if you want to see a recently compiled DC raster lesson, I also forked and heavily modified the regular one for this workshop. No issues compiling the site via GH Actions. https://github.com/cobalt-casco/r-raster-vector-geospatial

@jebyrnes
Copy link
Author

Oh - ok, now fully read your comment - ugh. Webshot no longer works properly, so had to move to webshot2. Will look deeper into setting up chrome.

Fortunately, I know the code works locally, so...... and the lesson went over well!

@Bisaloo
Copy link
Contributor

Bisaloo commented Mar 13, 2024

I'm not entirely sure how we arrive to the strange error in build logs but in case that's helpful, the system requirements ultimately come from https://github.com/rstudio/r-system-requirements/blob/c02f1175b9c137b3ffd999c860b451ea4376992e/rules/chrome.json, via Posit Package Manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants