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 502 and Base URL #42

Open
navneethc opened this issue Oct 28, 2024 · 3 comments
Open

Error 502 and Base URL #42

navneethc opened this issue Oct 28, 2024 · 3 comments

Comments

@navneethc
Copy link

navneethc commented Oct 28, 2024

I'm trying to set up an automated deployment pipeline for RShiny Apps in a RStudio/Posit Connect server hosted on-prem.

At the stage where the connect-publish action runs, I get a 502 Gateway Error.

Output from the workflow run in debug mode:

Run <Internal GitHub Org>/rstudio-connect/connect-publish@main
  with:
    url: https://rstudio-connect.internal.domain/
    api-key: ***
    access-type: logged_in
    dir: .:/test-branch-01
  
    force: false
    require-vanity-path: false
    show-logs: false
    update-env: true
    working-directory: .
  env:
    R_LIBS_USER: /home/runner/_work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.posit.co/cran/__linux__/jammy/latest
    RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/__linux__/jammy/latest
    RENV_PATHS_ROOT: /home/runner/_work/_temp/renv
##[debug]using base URL https://rstudio-connect.internal.domain/__api__
Error: Error: Request failed with status code [50](https://github.com/<Internal GitHub Org>/<repo-name>/actions/runs/11520639321/job/32166224220#step:10:50)2
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Publish Connect content

A few things to note:

  • I'm using a clone of this repository unchanged internally, since this action is not available via the GitHub Marketplace and therefore not whitelisted as per policy.
  • I'm using a custom runner in the workflow which can access internal domains in which I need to update an environment variable to get that working. There's a step early on where it is updated.
  • When I run a simple CURL command on a predefined endpoint I get a proper response using the same runner. Endpoint used: https://rstudio-connect.internal.domain/__api__/v1/server_settings/r -- but I hardcoded it.
@tdstein
Copy link
Contributor

tdstein commented Oct 29, 2024

Hi @navneethc,

Based on the information provided, it's difficult to determine the root cause of the 502 error code. To capture additional information, you could try setting show-logs: true.

Generally speaking, a 502 Bad Gateway would indicate that the GitHub runner cannot connect to the Posit Connect server. You mentioned that your GitHub runner is internal, so it seems you have considered that. But it may be worth making that CURL command call from the GitHub Action to verify the network configuration.

If necessary, see the section on Authentication for additional examples on how to configure your API key https://docs.posit.co/connect/api/#overview--authentication

@navneethc
Copy link
Author

Hi @tdstein, thanks for the reply. I set show-logs to true and yet nothing new showed up, even in debug mode.

With respect to the CURL command, I did run it from within another workflow in the same repository, using the same runner. (This was created specifically to test the connectivity.) Is that what you meant or did you mean that I should somehow do it from within connect-publish step/action?

@tdstein
Copy link
Contributor

tdstein commented Oct 29, 2024

Is that what you meant or did you mean that I should somehow do it from within connect-publish step/action?

Yes, it is. Thank you.

Are there any additional logs that you can provide that give additional insights into where in the execution of the action the 502 error is occurring? Additionally, can you confirm that a request to https://rstudio-connect.internal.domain/__api__/server_settings works as expected?

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

2 participants