Ralph Asher
Ralph Asher

Reputation: 226

R Plumber API on Digital Ocean: 502 BadGateway

I have (I think) deployed a plumber API on a DigitalOcean droplet. The droplet has R, plumber, and all necessary packages installed (I verified by going into the console). When I used plumberDeploy::do_deploy_api, R uploaded my directory files and ended with this:

â— plumber-mynewapi.service - Plumber API
     Loaded: loaded (/etc/systemd/system/plumber-mynewapi.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-10-13 03:04:45 UTC; 2s ago
   Main PID: 43431 (R)
      Tasks: 2 (limit: 1131)
     Memory: 252.4M
     CGroup: /system.slice/plumber-mynewapi.service
             └─43431 /usr/lib/R/bin/exec/R --no-echo --no-restore -e pr~+~<-~+~plumber::pr('/var/plumber/geovalidate/plumber.R');~+~pr$setDocs(FALSE);~+~~+~pr$run(port=8000)
[100%] C:\Users\mydir\AppData\Local\Temp\Rtmpiw5SiD\file3dc0450b6c70
/etc/nginx/sites-available/plumber-apis/mynewapi.conf

Api root url is droplet likely not up yet/mynewapi. Any endpoints from api will be served relative to this root.

The deployment completed two days ago, but I don't know how to actually access my API now (api name mynewapi).

I go to [[IP ADDRESS]]/mynewapi in my browser, and I just get

502 Bad Gateway nginx/1.18.0 (Ubuntu).

I did drop the "hello" API; before when I went to [[IP ADDRESS]]/mynewapi I saw the "plumber is alive!" screen.

This may be a simple answer, thanks for the help!

Upvotes: 1

Views: 79

Answers (0)

Related Questions