Is there a way to retrieve error states of shiny applications on Connect?

I am trying to find error states of deployed shiny applications so I can notify developers they may need to patch them. I have tried using the admin page on connect and the API but I have not found a way to determine if an application has an error without visiting the logs.

I have tried the /v1/experimental/content/{guid} endpoint to get the content details but it doesn't seem to tell me if the application loaded successfully or not.

Is there a way using the API capture an error state of a application? If there is not, is there a way to mass download the logs for each application?

Since this issue appears to be connected to an Posit Pro product, we are going to refer it to premium support (https://support.Posit.co/hc/en-us/requests/new)

Should a generalizable solution be reached we'll be sure to return here and share that.

Hi @lwagoner7

I think the jobs API endpoint is what you are after.

It provides the /jobs/ endpoint for all jobs on any particular content item showing (amongst other things):

tag: A tag to identify the nature of the job. It can be one of unknown, build_report, build_site, build_jupyter, packrat_restore, python_restore, configure_report, run_app, run_api, run_tensorflow, run_python_api, run_dash_app, run_streamlit, run_bokeh_app, run_fastapi_app, run_pyshiny_app, render_shiny, run_voila_app, testing, git, val_py_ext_pkg, val_r_ext_pkg, val_r_install, val_tensorflow.

exit_code: The job's exit code. Present only when job is finished.

status: The current status of the job. It can be one of Active: 0, Finished: 1, Finalized: 2.

It also provides, per job, API endpoints to Get job error and Get job log

Thanks,
Lachlan

1 Like

Since this issue appears to be connected to an Posit Pro product, we are going to refer it to premium support (https://support.Posit.co/hc/en-us/requests/new)

Should a generalizable solution be reached we'll be sure to return here and share that.

I'd love it if more was shared here - one customer's experience can help other customers with similar questions... and can inspire and assist us all in building bigger and better things!

Thanks Lachlan, the jobs endpoint was what I needed. The process I used to get the errors for each content item was a bit cumbersome though as neither the job endpoint or error/logs endpoints contained information on its parent. I see there is a PPID for parent process on the jobs entries but nothing that points towards the content item. I think if each Job had the GUID as an entry it would have helped streamline things a bit but I don't have a full understanding on how jobs work on the server.

1 Like

I am happy to pass this feedback onto the Connect team.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.