Problem/Motivation

Upgrade status reports the following warnings that I would like to understand and if necessary know how to troubleshoot. I have this warning a lot.

web/PHPStan failed

/usr/bin/php /var/www/vendor/bin/phpstan analyse --memory-limit=1500M --error-format=json --configuration=/tmp/upgrade_status/deprecation_testing.neon /www/web/modules/somemodule
Command output:

No! This is not for you! Your Drupal installation does not support utf8mb4. Have a fruitless look at https://www.drupal.org/docs/7/api/schema-api/data-types/encoding-collati... and then forget this module.Caught exception: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.

Command error:
Empty.

What does it refer to? Character SET of the tables? Collation? a module's file format?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

maxilein created an issue. See original summary.

gábor hojtsy’s picture

Is this included in the error like this?

No! This is not for you! Your Drupal installation does not support utf8mb4. Have a fruitless look at https://www.drupal.org/docs/7/api/schema-api/data-types/encoding-collati... and then forget this module."

maxilein’s picture

yes

gábor hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

Googling for that specific error message it comes up from https://www.drupal.org/forum/support/module-development-and-code-questio..., looks like you either use that custom module or someone very strongly got inspired by that code (copy-pasted it). This would be output when that code is run (since it echos and dies). The container in this case is not yet initiatialized because the error happens in a global context while the codebase is being assembled. Look at your own site codebase to find this code.

maxilein’s picture

Thank you very much.
I found it in the wayback filer module.
I will move the issue there.

maxilein’s picture

Title: Phpstan failed » Phpstan failed in upgrade_status when wayback_filter is present in filesystem
Project: Upgrade Status » Wayback Filter
Version: 4.3.6 » 1.2.0
Category: Support request » Bug report
Status: Postponed (maintainer needs more info) » Active

There seems to be an incomplete install routine (in \wayback_filter\wayback_filter.install) that causes errors when running upgrade_status.
Why do you need this routine?
Was it copied from somewhere and forgotten or does it fullfill a purpose?

steven snedker’s picture

I'm so sorry for
a) Not seeing this until now
b) Making such a shoddy error message

The utf8mb4 check in the install file has now been vastly improved.

Is it still useful?
My guess is that 99% of people running Drupal 10, 11 do it on a database using utf8mb4.

Yet, I made a utf8mb4 check in the install file in order to save the few poor souls not using utf8mb4 from a White Screen of Death upon installation.

Phpstan should not choke on version 1.2.1. My apologies for the old, shoddy version.

steven snedker’s picture

Assigned: Unassigned » steven snedker
Status: Active » Fixed

Solved by v1.2.1.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

maxilein’s picture

thank you!