Cms: Upgraded to 3.6 and graph QL query is broken in production mode, but not dev mode.

Created on 27 Jan 2021  路  12Comments  路  Source: craftcms/cms

Description

After upgrading from 3.5 to 3.6.0.1 my graphQL query is broken.
The problem exists in both the front end and in the dashboard GraphiQL.

I can reproduce in local, staging and live environments.

When the site is in dev mode it works perfectly:

image

When in production mode this is the error I get:

image

Nothing comes up in the logs.

I've tried clearing storage, all caches, checking all migrations are run.

I'm not sure how to proceed from here.

Additional info

  • Craft version: 3.6.0.1
  • PHP version: 7.4.12 and 7.4.13 (local, live) [edited to show correct version nos]
  • Database driver & version: MySQL 8.0.22
  • Plugins & versions: n/a
bug

Most helpful comment

Just traced it down to a behavior change in the underlying GraphQL package we use and pushed a fix for it.

To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#b6fe803404058126bb506689d7ef46db8809a57c as 3.6.1",
  "...": "..."
}

Then run composer update.

All 12 comments

Craft 3.6 requires PHP 7.2.5 or later. Can you please ensure you鈥檙e running at least that? (Ideally 7.4.x though.)

Yeah @brandonkelly - sorry - typo on my part. Both 7.4.12 and 7.4.13.

Alright, can you please send a database backup, your Composer files, and the raw text of that GraphQL query over to [email protected] so we can look into it?

Thanks - done :)

@sunscreem It looks like the newsCategories field might not exist or be set up correctly in production.

I was unable to reproduce the error you're encountering with the files you sent over.

However, I just improved GraphQL error logging. To pull this improvement in your environment, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#67682d5a2d9e7f76ee0a14e477b81323c6ebf82d as 3.6.1",
  "...": "..."
}

Then run composer update.

Now, running the query should log the exception responsible for the error to your log files.

Thanks @bencroker. I'll come back to you.

@sunscreem okay, got it to reproduce locally, too. I'll let you know!

Just traced it down to a behavior change in the underlying GraphQL package we use and pushed a fix for it.

To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#b6fe803404058126bb506689d7ef46db8809a57c as 3.6.1",
  "...": "..."
}

Then run composer update.

Hey @andris-sevcenko. That's working now :)

https://taurx.com/media-news

Glad to hear it!

Craft 3.6.2 is out now with that fix.

Was this page helpful?
0 / 5 - 0 ratings