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

Redirects and Headers stopped working on Netlify (and work again in gatsby 5.12.12 / adapter 1.0.4) #38752

Closed
2 tasks done
laurenskling opened this issue Dec 12, 2023 · 9 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. topic: adapters Related to Gatsby Adapters type: bug An issue or pull request relating to a bug in Gatsby

Comments

@laurenskling
Copy link
Contributor

Preliminary Checks

Description

My sites weren't processing things like headers and redirects anymore since Dec 7th, between 3:13PM and 4:09PM (GMT+1)

I thought it was netlify/plugin-gatsby 3.8.0 but it's probably [email protected] or .12 or something that did it.

Nuking my yarn.lock and installing gatsby 5.12.12 (I was running 5.12.3), gatsby-adapter-netlify 1.0.4 (from 1.0.0) made redirects and headers work again.

Just wanted to throw it out there for others who might have their clients calling that redirects aren't working anymore 🥲

Reproduction Link

https://gatsby.dev/reproduction

Steps to Reproduce

  1. have gatsby 5.12.3
  2. build a site with redirects
  3. they dont work
  4. installed @latest
  5. it works.
    ...

Expected Result

Things not breaking

Actual Result

Things breaking

Environment

System:
    OS: macOS 13.6.1
    CPU: (8) arm64 Apple M2
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - /var/folders/50/3fndm5d13gs_kr96nwxpxd9c0000gn/T/yarn--1702407952305-0.35108371319464915/node
    Yarn: 1.22.19 - /var/folders/50/3fndm5d13gs_kr96nwxpxd9c0000gn/T/yarn--1702407952305-0.35108371319464915/yarn
    npm: 9.8.1 - /usr/local/bin/npm
  Languages:
    Python: 3.10.9 - /usr/local/bin/python
  Browsers:
    Chrome: 120.0.6099.71
    Safari: 17.1

Config Flags

No response

@laurenskling laurenskling added the type: bug An issue or pull request relating to a bug in Gatsby label Dec 12, 2023
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 12, 2023
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 14, 2023
@pieh
Copy link
Contributor

pieh commented Dec 14, 2023

This is probably related to #38745 which was released in timeframe you reported.

Did the builds with not working redirects perhaps had warning line like that?

gatsby-adapter-netlify@X is not compatible with your current Gatsby version

Looking at the code I do see that it would then skip trying to use adapter completely if manually managed adapter version is deemed incompatible with used gatsby version and that would make it so nothing tries to handle redirects.

I do think it probably should discard used version when deemed in compatible and try to install compatible one to avoid this or maybe just fail the build with informative message to avoid those broken deploys - but before doing any improvements there, it would be good to confirm my assumption about how that happened and wether warning did happen in build logs

@pieh pieh added the topic: adapters Related to Gatsby Adapters label Dec 14, 2023
@laurenskling
Copy link
Contributor Author

Yes I now see it as well:

4:11:32 PM: warning [email protected] is not compatible with your current Gatsby version 5.12.3 - Install [email protected] or later.

I did not spot this earlier, there's a lot in my logs ;)

Yeah, I would really wished this was a crash, not a warning. Now my builds were inacurate for 7 days, because I have some business logic that rely on the redirects.

@pieh
Copy link
Contributor

pieh commented Dec 14, 2023

I will make it crash, but of course this would only applicable to new gatsby versions and can't really make already released versions handle it properly.

After few thoughts - discarding user managed adapter version and installing "compatible" one is not good, because it would lose any adapter options that user specified, so failing the build is the best solution here

@laurenskling
Copy link
Contributor Author

Yeah in my opinion crashing (with a good message) and letting me fix it is always best. It's build time.

You cannot allow 1.0.0-1.0.3 in that manifest file? That would fix it as well right?

@pieh
Copy link
Contributor

pieh commented Dec 15, 2023

You cannot allow 1.0.0-1.0.3 in that manifest file? That would fix it as well right?

I can and will update it to allow those versions (was doing some testing and >=1.0.0 <=1.0.3 is valid version selector not only for verifying version range, but also as argument for npm install gatsby-adapter-netlify@">=1.0.0 <=1.0.3" which would be used for "zero-conf" scenarios)

But that will be part of changes to break the build for incompatible versions by default to prevent potentially broken deploys like ones you reported (there will be escape hatch to continue the build with things as-is but this is something that user will have to opt into meaning they acknowledge gatsby doesn't want to allow that and basically user become responsible for potential problems caused by "incompatibility")

@pieh
Copy link
Contributor

pieh commented Dec 15, 2023

Actually - I will split things - I wasn't sure initially if installation will continue to work with code as-is (just knew it could work overall, but possibly changes were needed). As I looked into adjusting the behavior it was clear I will need to spend quite a bit of time on testing new behavior in bunch of scenarios - so at least for now I could do quick relaxation of compatible version to help with the issue faster and improve the logic as next step.

So #38758 will update just the manifest

Copy link

github-actions bot commented Jan 4, 2024

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jan 4, 2024
@pieh pieh removed the stale? Issue that may be closed soon due to the original author not responding any more. label Jan 8, 2024
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jan 28, 2024
Copy link

github-actions bot commented Mar 8, 2024

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

@github-actions github-actions bot closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. topic: adapters Related to Gatsby Adapters type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants