Urban-Analytics / RAMP-UA

https://urban-analytics.github.io/RAMP-UA/
MIT License
15 stars 10 forks source link

server setup #117

Closed jabrams23 closed 3 years ago

jabrams23 commented 4 years ago

Hey everyone,

this is a more general question. I am trying to get the model up and running on the server. I got everything installed, but am getting some errors. It looks like the conda environment is trying to access the wrong version of R, but I can't get it to behave. If anyone has any ideas on how to fix this then please let me know (@nickmalleson @Sparrow0hawk ). The error is as follows:

(/root/my-conda-envs/ramp-ua) root@jupyter-jabrams23:~/COVID/RAMP-UA# python microsim/microsim_model.py Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/library/methods/libs/methods.so': /usr/local/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler Warning messages: 1: package ‘methods’ was built under R version 4.0.2 2: package "methods" in options("defaultPackages") was not found Error: package or namespace load failed for ‘grDevices’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so': /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_translateCharFP Error: package or namespace load failed for ‘graphics’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so': /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_translateCharFP Error: package or namespace load failed for ‘stats’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/library/grDevices/libs/grDevices.so': /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol: Rf_translateCharFP Error: package or namespace load failed for ‘methods’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/library/methods/libs/methods.so': /usr/local/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler During startup - Warning messages: 1: package ‘datasets’ was built under R version 4.0.2 2: package ‘utils’ was built under R version 4.0.2 3: package ‘grDevices’ was built under R version 4.0.2 4: package ‘grDevices’ in options("defaultPackages") was not found 5: package ‘graphics’ was built under R version 4.0.2 6: package ‘graphics’ in options("defaultPackages") was not found 7: package ‘stats’ was built under R version 4.0.2 8: package ‘stats’ in options("defaultPackages") was not found 9: package ‘methods’ was built under R version 4.0.2 10: package ‘methods’ in options("defaultPackages") was not found R[write to console]: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/usr/local/lib/R/library/methods/libs/methods.so': /usr/local/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler

Traceback (most recent call last): File "microsim/microsim_model.py", line 23, in from r_interface import RInterface File "/home/jovyan/COVID/RAMP-UA/microsim/r_interface.py", line 3, in import rpy2.robjects.packages as rpackages # For installing packages File "/root/my-conda-envs/ramp-ua/lib/python3.7/site-packages/rpy2/robjects/init.py", line 19, in from rpy2.robjects.robject import RObjectMixin, RObject File "/root/my-conda-envs/ramp-ua/lib/python3.7/site-packages/rpy2/robjects/robject.py", line 58, in class RObjectMixin(object): File "/root/my-conda-envs/ramp-ua/lib/python3.7/site-packages/rpy2/robjects/robject.py", line 70, in RObjectMixin __show = _get_exported_value('methods', 'show') File "/root/my-conda-envs/ramp-ua/lib/python3.7/site-packages/rpy2/rinterfacelib/conversion.py", line 44, in cdata = function(*args, **kwargs) File "/root/my-conda-envs/ramp-ua/lib/python3.7/site-packages/rpy2/rinterface.py", line 621, in call raise embedded.RRuntimeError(_rinterface._geterrmessage()) rpy2.rinterface_lib.embedded.RRuntimeError: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/usr/local/lib/R/library/methods/libs/methods.so': /usr/local/lib/R/library/methods/libs/methods.so: undefined symbol: R_withCallingErrorHandler

(/root/my-conda-envs/ramp-ua) root@jupyter-jabrams23:~/COVID/RAMP-UA#

Sparrow0hawk commented 4 years ago

This looks like somewhere there's been compilation problems.

Within the Conda environment are you able to load the R console by just typing

R

Side note, I'd recommend create your own user on the server and working within that user rather than root and then using sudo if you need to escalate privileges. See steps here around creating new user.

jabrams23 commented 4 years ago

Thanks I’ll check on that when back at my computer. I wanted to put the directory into root so that other users have access to it.

On 21. Aug 2020, at 12:46, Alex Coleman notifications@github.com wrote:

 This looks like somewhere there's been compilation problems.

Within the Conda environment are you able to load the R console by just typing

R Side note, I'd recommend create your own user on the server and working within that user rather than root and then using sudo if you need to escalate privileges. See steps here around creating new user.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Sparrow0hawk commented 4 years ago

OK, so if we're sharing things with other users we'd definitely want to create a series of new user accounts from which we can manage their access to the server. We definitely want to avoid everyone having access to the root user as that's a major security concern.

I'd recommend:

jabrams23 commented 4 years ago

ok. I do have a user account and so do Fiona and Gavin. I think these will be the only people using this for now (and maybe you). I am back at my computer and was able to test R. I am able to load an R console.

On 21 Aug 2020, at 14:17, Alex Coleman notifications@github.com wrote:

OK, so if we're sharing things with other users we'd definitely want to create a series of new user accounts from which we can manage their access to the server. We definitely want to avoid everyone having access to the root user as that's a major security concern.

I'd recommend:

create a user for yourself create the model with /home/your_username/ directory we'd then adjust the permissions around the model directory so that other users can access then create new users as and when needed who can access and use the model — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Urban-Analytics/RAMP-UA/issues/117#issuecomment-678285741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUDMANN3SS7M5IEEVH7HQLSBZXXHANCNFSM4QHFTC5A.

jabrams23 commented 4 years ago

Also when I type ‘which R’ I get '/root/my-conda-envs/ramp-ua/bin/R’ so the Conda environment R is there. It just seems that when trying to run the code its looking at '/usr/local/lib/R/library/grDevices/libs/grDevices.so’

Maybe you are correct and its cause its in the root directory and not in a user directory. I know anaconda sometimes has problems due to this

On 21 Aug 2020, at 14:28, Jesse Abrams jabrams23@gmail.com wrote:

ok. I do have a user account and so do Fiona and Gavin. I think these will be the only people using this for now (and maybe you). I am back at my computer and was able to test R. I am able to load an R console.

On 21 Aug 2020, at 14:17, Alex Coleman <notifications@github.com mailto:notifications@github.com> wrote:

OK, so if we're sharing things with other users we'd definitely want to create a series of new user accounts from which we can manage their access to the server. We definitely want to avoid everyone having access to the root user as that's a major security concern.

I'd recommend:

create a user for yourself create the model with /home/your_username/ directory we'd then adjust the permissions around the model directory so that other users can access then create new users as and when needed who can access and use the model — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Urban-Analytics/RAMP-UA/issues/117#issuecomment-678285741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUDMANN3SS7M5IEEVH7HQLSBZXXHANCNFSM4QHFTC5A.

Sparrow0hawk commented 4 years ago

If you run:

Rscript -e '.libPaths()'

What directory location does it return? It may be worth trying a build in your /home/username/ directory and see if this problem still occurs.

jabrams23 commented 4 years ago

Ok I’m going to try all over with installing everything

On 21 Aug 2020, at 14:39, Alex Coleman notifications@github.com wrote:

If you run:

Rscript -e '.libPaths()' What directory location does it return? It may be worth trying a build in your /home/username/ directory and see if this problem still occurs.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Urban-Analytics/RAMP-UA/issues/117#issuecomment-678295920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUDMAP7K4I2DDWKOEIPS43SBZ2KRANCNFSM4QHFTC5A.

github-actions[bot] commented 3 years ago

Branch jabrams23-issue-117 created!