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

Vercel Integration Problem: Failed to save #23875

Open
Tracked by #59564
jake-nz opened this issue Feb 15, 2021 · 15 comments
Open
Tracked by #59564

Vercel Integration Problem: Failed to save #23875

jake-nz opened this issue Feb 15, 2021 · 15 comments

Comments

@jake-nz
Copy link

jake-nz commented Feb 15, 2021

Important Details

How are you running Sentry?
Saas (sentry.io)

Description

"Failed to save" when connecting Vercel and Sentry projects
image
Note: I did fill in the dropdowns but they get cleared when the error happens

Console output: Error saving form field {detail: "Internal Error", errorId: "53fa48b62cdf4533918e2fc262833b3a"}

Possibly relevant: I'm on free, grandfathered Vercel plan

Steps to Reproduce

  1. Visit https://sentry.io/settings/{my-org}/integrations/vercel/
  2. Click Configurations, Click Configure
  3. Select a Vercel and Sentry project, click [+]

What you expected to happen

Expected integration to be added

Possible Solution

Sorry, no ideas

@jake-nz
Copy link
Author

jake-nz commented Feb 15, 2021

Update: I've just tried another Vercel & Sentry project, which worked. This issue seems to be specific to one Vercel project. I can't connect this project to any Sentry project

@jake-nz
Copy link
Author

jake-nz commented Feb 15, 2021

Update:
I've discovered that, for the projects which work, the following env vars get added to Vercel:
VERCEL_GITHUB_COMMIT_SHA, SENTRY_AUTH_TOKEN, SENTRY_DSN, SENTRY_PROJECT, SENTRY_ORG
For the project that fails, two are added:
SENTRY_PROJECT, SENTRY_ORG

@jake-nz
Copy link
Author

jake-nz commented Feb 15, 2021

Update:
After noticing is_next_js here

is_next_js = vercel_project.get("framework") == "nextjs"
I realised that a key difference with the problem Vercel project is that it's next.js-based.
I had already created an env var in Vercel called NEXT_PUBLIC_SENTRY_DSN after deleting this I no longer get the error and I can set up my project!

I'm not closing this issue because the problem remains: If you already have a Vercel environment variable with the same name as the one Sentry tries to create, you get "Failed to save"

@MeredithAnya
Copy link
Member

@jake-nz Thanks for opening this and also for your updates :) We have this on our radar to fix, but for anyone else that may come across this in the meantime:

I had already created an env var in Vercel called NEXT_PUBLIC_SENTRY_DSN after deleting this I no longer get the error and I can set up my project!

deleting the NEXT_PUBLIC_SENTRY_DSN env var for your Vercel project is the workaround (if you have that set already before connecting your project with Sentry)

We'll comment and close this issue once we deploy the fix.

@ceorourke
Copy link
Member

@jake-nz this should be fixed but please reopen if it's not!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2021
@lforst lforst reopened this Apr 13, 2023
@getsentry getsentry unlocked this conversation Apr 13, 2023
@lforst
Copy link
Member

lforst commented Apr 13, 2023

@gfpacheco reported that this issue is occurring again: getsentry/sentry-javascript#7843

@mcavaliere
Copy link

Can confirm that it's still happening.

Some detail which took me a minute to find out - it looks as if it will fail mid-way through updating environment variables if any SENTRY_* env vars exist in Vercel; at that point, it will continue to fail until ALL SENTRY_* environment variables are deleted. At that point, it succeeded for me.

@lforst
Copy link
Member

lforst commented Apr 19, 2023

@mcavaliere Nice investigative work! Thank you very much! Can't give a timeline yet but we should fix this.

What would be the desired behaviour for you? Would it be to override the existing env vars or to only set the ones that do not exist yet?

@mcavaliere
Copy link

@lforst No problem!

Ideally behavior would be an option the user could select, override vs merge. If I had to pick, merge is probably safer. But to me the merge/override strategy is less important than:

  1. Not failing midway (at least, not without clear messaging about what happened)
  2. Letting the user know what's about to happen (e.g., your env vars will be overwritten/merged)

@lforst
Copy link
Member

lforst commented Apr 26, 2023

Heard back from folks at Vercel:

[at]LucaForstner answer from engineering:
I assume they need a specific name so that the Sentry library can use that env var.
They should handle this error in the integration and show an error to the user saying that the env var already exists. They need to inform the user that if they want the integration to manage all the Sentry related env vars, then the users would have to delete the existing env var.
They can also show a button to “retry” creating the env vars after the users have deleted the existing env var.

These seem to be our options. Might require some changes in the UI.

@alex-grover
Copy link

I'm seeing this same error, even when there are no existing SENTRY_* env vars set in Vercel.

@FadiAboMsalam
Copy link

@mcavaliere i had the same issue i had to remove all SENTRY_* env variables from Vercel before integration could succeed and reAdd the environment variables needed afterwards

@getsantry
Copy link
Contributor

getsantry bot commented Jul 25, 2023

Routing to @getsentry/product-owners-settings-integrations for triage ⏲️

@aloysb
Copy link

aloysb commented Nov 27, 2023

Same here, despite removing all SENTRY_*, the problem persists.

@adamkangas
Copy link

adamkangas commented Dec 4, 2023

The problem is happening on some of my projects too. Removing SENTRY_* doesn't help

Edit: It does work if you also remove VERCEL_GITHUB_COMMIT_SHA, which won't come up if you are just filtering by *SENTRY*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests