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

Error in rsync_remote yields no output #18

Closed
shahrozeabbas opened this issue Jun 25, 2019 · 10 comments
Closed

Error in rsync_remote yields no output #18

shahrozeabbas opened this issue Jun 25, 2019 · 10 comments

Comments

@shahrozeabbas
Copy link

I have been unable to produce an output using qsub_lapply. I only tried to run the example of incrementing 1:3 by 1. There's an error for rsync and the log files have this message:

ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'R'
export: Command not found.
export: Command not found.
MANPATH: Undefined variable.
Rscript: Command not found.

@rcannood
Copy link
Owner

Could you give me some information on the system you are trying to submit a job on? What are the usual commands you enter when submitting a job?

@shahrozeabbas
Copy link
Author

shahrozeabbas commented Jun 26, 2019

It is a university cluster running CentOS 5.11 and I am using R 3.5.1 which has to be sourced prior to calling R. I use the command qsub myscript.sh to submit a job and qrsh for an interactive login. The cluster uses GridEngine for jobs.

These are my commands locally:
config <- create_qsub_config(remote = remote, local_tmp_path=local_tmp, remote_tmp_path=remote_tmp, execute_before=r_source)

qsub_lapply(1:3, function(x) x + 1, qsub_config=config)

This is my error:
Error in rsync_remote(remote_src = qs$remote, path_src = qs$remote_logdir, : rsync failed:

Along with those error messages in log.1.e, log.2.e, log.3.e files mentioned in the original post.

@zouter
Copy link
Collaborator

zouter commented Jun 26, 2019

Just to make sure something can be executed on the remote system, could you do:
qsub::run_remote("echo hello", remote = remote) ?

If that completes successfully, could you try to rsync something to the remote system:

file <- tempfile()
write("hello", file)
qsub::rsync_remote(FALSE, file, remote, "~/test")

Because of the first error you gave, it's highly unlikely that these commands will succeed, but then we can troubleshoot further!

@shahrozeabbas
Copy link
Author

It looks like the first command succeeded, but the second failed with the same error mentioned above.

@zouter
Copy link
Collaborator

zouter commented Jun 26, 2019

Could you then run

file <- tempfile()
write("hello", file)
qsub::rsync_remote(FALSE, file, "prism", "~/test", verbose = TRUE)

and then run the first line you get (without the #) in the command line? Then we'll know the exact error

@shahrozeabbas
Copy link
Author

shahrozeabbas commented Jun 26, 2019

This did not complete successfully. Returned the error:

Error in parse_remote(remote_dest) : object 'username' not found

I also tried running rsync_remote line by line and it seems fetch_hostname_from_config returns NULL. I tried to debug but not familiar with keep in lInes 19, 24, 29.

@zouter
Copy link
Collaborator

zouter commented Jun 27, 2019

Sorry, I meant

file <- tempfile()
write("hello", file)
qsub::rsync_remote(FALSE, file, remote, "~/test", verbose = TRUE)

(prism is our remote 😉 )

@shahrozeabbas
Copy link
Author

So the first line that was returned from that command was the rsync command and when I ran that in command line, it seems to have executed correctly. There is now a test file with 'hello' written in my remote directory.

@rcannood
Copy link
Owner

rcannood commented Jul 1, 2019

You said that this is the code you are trying to run:

config <- create_qsub_config(remote = remote, local_tmp_path=local_tmp, remote_tmp_path=remote_tmp, execute_before=r_source)
qsub_lapply(1:3, function(x) x + 1, qsub_config=config)

What is the content of r_source?

Also, could you run the following code?

library(qsub)
config <- create_qsub_config(
  remote = remote,
  local_tmp_path = local_tmp,
  remote_tmp_path = remote_tmp, 
  execute_before = r_source,
  remove_tmp_folder = FALSE
)
qsub_lapply(1:3, function(x) x + 1, qsub_config = config)

By setting remove_tmp_folder to FALSE, the folder that qsub creates at remote_tmp on the remote will not be removed, even if an error was produced. Inside, you should find a script.sh and script.R. script.sh should look something like this:

#!/bin/bash
#$ -t 1-3
#$ -N myjob
#$ -l h_vmem=10G
cd /path/to/your/folder
module unload R
Rscript --default-packages=methods,stats,utils,graphics,grDevices script.R $SGE_TASK_ID

One of the errors (Unable to locate a modulefile for 'R') will be caused by the module unload R. The other errors are likely related to whatever is in r_source. What does your script.sh look like?

@rcannood
Copy link
Owner

Closing this due to inactivity. Let me know if you have any more updates on this.

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