Closed hjzhou988 closed 2 months ago
@hjzhou988 what happens when you follow step 1 to 4 from the readme setup section?
I went through 1 to 4, and analogsea::droplets() can show me not only the initial active server that I created on digital ocean, but also the plumber servers that created by plumberDeploy::do_provision().
I'll try to replicate, thanks for the response and report.
@hjzhou988 would you mind installing the github version and testing if it works for you? I will publish to CRAN after that.
@meztez Thank you! However, after I installed the github version, it's still not working. It seems to be related to nginx:
> plumberDeploy::do_deploy_api(droplets()[[2]], "date", "test_api/", 8000, docs = TRUE, keyfile = "id_digital_ocean",overwrite = T )
stopping service: plumber-date
disabling service: plumber-date
Removed /etc/systemd/system/multi-user.target.wants/plumber-date.service.
removing service: plumber-date
removing config: plumber-date
rm: cannot remove '/etc/nginx/sites-available/plumber-apis/date.conf': No such file or directory
reloading nginx: plumber-date
Failed to reload nginx.service: Unit nginx.service not found.
reloading plumber folder: plumber-date
[100%] /Users/huajunzhou/Documents/Model_recommend/test_api/plumber.R
/tmp/XOGEHRPHFH
[100%] /private/var/folders/x1/_wrl1b7d19lbns1c894kf9q00000gp/T/RtmpaSqfKg/file154bae42ac58
/etc/systemd/system/plumber-date.service
Failed to start plumber-date.service: Unit plumber-date.service has a bad unit file setting.
See system logs and 'systemctl status plumber-date.service' for details.
Error: ssh failed
systemctl start plumber-date && sleep 1
That would be an error with starting the plumber service, most likely due to a missing R library. It will depends on the content of the plumber R file.
You mean the plumber.R file? In the file, I only included the example API:
#* @get /
function() {
Sys.Date()
}
I wonder if the do_provision default exemple = TRUE already added the service to the machine?
Good point! I didn't realize that I didn't try the new do_provision() function. I just tried it, and it established a server different from previous. I tried typing in
systemctl status plumber-hello
The example API is running. And I disabled and stopped the plumber-hello service, and use do_deploy_api() to upload the "date" API, and now it is running. Thank you very much for your update!
System details
Output of
sessioninfo::session_info()()
:Example application or steps to reproduce the problem
Describe the problem in detail
Hi, I tried to use do_provision() to deploy a sample API with my private key, but it returns the "Error: Authentication with ssh server failed", even though the new server key was generated. What could be the cause for this error? Also I tried to deploy the example "date" API with the command above, but still failed with error: "mv: cannot move '/tmp/JLOUIHVOWC/api' to '/var/plumber/date': No such file or directory Error: ssh failed" So I manually created a /var/plumber/ directory in the server, and redo the do_deploy_api command. The error then becomes: "Error: ssh failed"
How do I solve this issue?