meztez / plumberDeploy

Other
50 stars 12 forks source link

SSH Failed when using PlumberDeploy #33

Closed alphatecht closed 2 years ago

alphatecht commented 2 years ago

Problem

I was using PlumberDeploy successfulyy until yesterday Now I have an "SSH Failed" error when deploying a plumber API on DigitalOcean

System details

[1] D:/R/R-4.0.2/library

Describe the problem in detail

I have just tried to execute plumberDeploy::do_provision() function. After several minutes it returns an error :

plumberDeploy::do_deploy_api(id, "data_api", "./MyAPI/",8000, docs = TRUE,overwrite = T) stopping service: plumber-data_api Failed to stop plumber-data_api.service: Unit plumber-data_api.service not loaded. disabling service: plumber-data_api Failed to disable unit: Unit file plumber-data_api.service does not exist. removing service: plumber-data_api rm: cannot remove '/etc/systemd/system/plumber-data_api.service': No such file or directory removing config: plumber-data_api rm: cannot remove '/etc/nginx/sites-available/plumber-apis/data_api.conf': No such file or directory reloading nginx: plumber-data_api reloading plumber folder: plumber-data_api [100%] D:\Plumber Files\MyAPI\plumber.R /tmp/WSLQWTURYU [100%] C:\Users\Public\Documents\Wondershare\CreatorTemp\RtmpCKHa9a\file39281d78876 /etc/systemd/system/plumber-data_api.service Created symlink /etc/systemd/system/multi-user.target.wants/plumber-data_api.service → /etc/systemd/system/plumber-data_api.service. â—plumber-data_api.service - Plumber API Loaded: loaded (/etc/systemd/system/plumber-data_api.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2021-10-25 20:08:33 UTC; 1s ago Main PID: 39669 (code=exited, status=1/FAILURE)

Oct 25 20:08:32 DoablePairing systemd[1]: Started Plumber API. Oct 25 20:08:33 DoablePairing Rscript[39669]: Error in stopOnLine(lineNum, file[lineNum], e) : Oct 25 20:08:33 DoablePairing Rscript[39669]: Error on line #30: 'library(tidyr)' - Error in library(dbplyr): there is no package called ‘dbplyr’ Oct 25 20:08:33 DoablePairing Rscript[39669]: Calls: ... tryCatchList -> tryCatchOne -> -> stopOnLine Oct 25 20:08:33 DoablePairing Rscript[39669]: Execution halted Oct 25 20:08:33 DoablePairing systemd[1]: plumber-data_api.service: Main process exited, code=exited, status=1/FAILURE Oct 25 20:08:33 DoablePairing systemd[1]: plumber-data_api.service: Failed with result 'exit-code'. Error: ssh failed systemctl status plumber-data_api

The API is working locally

alphatecht commented 2 years ago

How to use password rather than SSH in using PlumberDeploy?

meztez commented 2 years ago

@alpha-wise

It seems the service failed to start because the required libraries are not installed on your droplet.

analogsea::install_r_package(
  droplet,
  package,
  repo = "https://cloud.r-project.org/",
  user = "root",
  keyfile = NULL,
  ssh_passwd = NULL,
  verbose = FALSE
)

What you see Error: ssh failed means the command issued to your droplet via ssh failed. The relevant error is 5-6 lines above.

Oct 25 20:08:33 DoablePairing Rscript[39669]: Error on line #30: 'library(tidyr)' - Error in library(dbplyr): there is no package called ‘dbplyr’

alphatecht commented 2 years ago

Thanks for the explanation. I will correct that