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

Lando 3.17.0 causes issue with json api module #56

Closed
vermario opened this issue May 15, 2023 · 6 comments
Closed

Lando 3.17.0 causes issue with json api module #56

vermario opened this issue May 15, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@vermario
Copy link

vermario commented May 15, 2023

Hello!

The new 3.17.0 version of lando seems to have issues with the JSONAPI Drupal core module (Drupal 10, latest version).

Symptom:

Jsonapi responds with an error:

"The following query parameters violate the JSON:API spec: 'q'."

image

How to reproduce

You could reproduce this by:

  1. cloning this repository: https://github.com/wunderio/drupal-project (we use it at our company for all projects, it's been well tested)
  2. make sure you have lando 3.17 installed
  3. lando start && lando drush si -y && lando drush en jsonapi -y
  4. visit https://drupal-project.lndo.site/jsonapi and witness the error.

Now, remove 3.17.0, reinstall 3.11, lando destroy and repeat the operations above, and jsonapi will work normally.

In another project of ours, where Drupal is installed in a subdirectory, we instead get a redirect loop at /jsonapi with 3.17.0, but all normal with 3.11.

This has been confirmed by a coworker with a different development machine.

I have found this issue in Drupal.org: https://www.drupal.org/project/jsonapi/issues/2984044 which refers to some configuration in nginx that jsonapi responds to by throwing this error. Was some default nginx configuration changed in this release?

Hope this helps!

@vermario vermario added the bug Something isn't working label May 15, 2023
@vermario
Copy link
Author

I have tested this with the newly released 3.17.1, and the same error happens.

@reynoldsalec
Copy link
Sponsor Member

Could be a change in the NGINX config between 3.11 and 3.17...could be good to add a test to our Drupal suite once we fix this.

@reynoldsalec
Copy link
Sponsor Member

I'm going to replicate this on a stock drupal10 recipe, and if I have the same issue, first try reverting this NGINX config change, which appears to be the only one made between the relevant Drupal plugin versions.

@millnut
Copy link
Contributor

millnut commented May 16, 2023

Confirming it is related to that nginx change, just creating a PR now for it

millnut added a commit to millnut/lando-drupal that referenced this issue May 16, 2023
@millnut
Copy link
Contributor

millnut commented May 16, 2023

Fixed in this PR #57

reynoldsalec added a commit to millnut/lando-drupal that referenced this issue May 17, 2023
reynoldsalec added a commit that referenced this issue May 17, 2023
* fix regression caused by #56

* #56: Add test to confirm jsonapi returning expected output.

---------

Co-authored-by: Alec Reynolds <[email protected]>
@reynoldsalec
Copy link
Sponsor Member

Ok, added this change in and released in v0.10.0 of the Drupal plugin. That'll go out in the next Lando release, until then you can always do a "custom" install of the Drupal plugin: https://docs.lando.dev/drupal/getting-started.html#custom-installation

One weird item; I wasn't able to replicate this bug in a vanilla D10 setup. It may have just been an artifact of my testing/late night, but I think @millnut replicated this at least on a different setup, so I'm pretty confident it's an issue. Would also love to improve my test to more specifically target the error case if anyone has an idea on that: https://github.com/lando/drupal/blob/v0.10.0/examples/drupal10/README.md?plain=1#L74

Thanks @vermario for the detailed report and @millnut for addressing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants