Getting upexpected item 'parameteres > drupal'

Created on 22 January 2024, 11 months ago

Problem/Motivation

I am getting below error when running drush command to check deprecated code with Drupal 10.1

Steps to reproduce

goto drupal project folder
./vendor/bin/drush us-a --all --ignore-contrib

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇮🇳India nitesh624 Ranchi, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nitesh624
  • 🇮🇳India nitesh624 Ranchi, India
  • Status changed to Postponed: needs info 10 months ago
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Interesting, the module's default .neon file (see https://git.drupalcode.org/project/upgrade_status/-/blob/4.x/deprecation...) does not have Drupal in the parameters list and neither should the processed version have that. What is the content of the .neon file from the error message?

    This one: /tmp/upgrade_status/deprecation_testing.neon

  • 🇪🇸Spain manuel garcia

    I'm also facing the same issue, running drupal-check 1.4.0 and Upgrade Status 4.3.1.

    Here are the contents of the neon file:

    cat /tmp/upgrade_status/deprecation_testing.neon
    # FROM mglaman/drupal-check/phpstan/deprecation_testing.neon
    parameters:
            tmpDir: '/tmp/upgrade_status/phpstan'
            drupal:
                    drupal_root: '/var/www/html/web'
            parallel:
                    maximumNumberOfProcesses: 0
            customRulesetUsed: true
            ignoreErrors:
                    - '#\Drupal calls should be avoided in classes, use dependency injection instead#'
                    - '#Plugin definitions cannot be altered.#'
                    - '#Missing cache backend declaration for performance.#'
                    - '#Plugin manager has cache backend specified but does not declare cache tags.#'
    
            # FROM mglaman/drupal-check/phpstan/base_config.neon
            reportUnmatchedIgnoredErrors: false
            excludePaths:
                    - */tests/Drupal/Tests/Listeners/Legacy/*
                    - */tests/fixtures/*.php
                    - */settings*.php
                    - */bower_components/*
                    - */node_modules/*
    
  • 🇪🇸Spain rodrigoaguilera Barcelona

    @Manuel Garcia

    Can you verify the contents of vendor/phpstan/extension-installer/src/GeneratedConfig.php
    to ensure you have the drupal extension properly installed?

    Might be that some permissions didn't allow writing to it and it stays outdated without installing the Drupal extension for phpstan.

  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Note that I was incorrect in February above. The generated config does indeed contain the Drupal key, we are putting it there :)

  • 🇭🇺Hungary Balu Ertl Budapest 🇪🇺
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Fix typo in title for searchability.

  • 🇭🇺Hungary Gábor Hojtsy Hungary

    In Disable ClassExtendsInternalClassRule Fixed we added the Drupal key by default to the template neon, but that template is further processed by the module to add the location of the included libraries. If the template is used without that, then the drupal key will be invalid. See DeprecationAnalyzer::createModifiedNeonFile(). Maybe something like that is happening here? If the includes cannot be added, an exception is thrown.

    I noticed that the exception is only resulting in a user facing error on the UI (see top of UpgradeStatusForm::buildForm()). Unfortunately we are not surfacing environment exceptions to the Drush command which sounds like a problem :D See DeprecationAnalyzer::analyze() silently catching exceptions and UpgradeStatusCommands.php not calling initEnvironment but relying on the analyze, which silences problems.

  • Status changed to Needs review 6 months ago
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    I made an entirely untested proposal for how this could look like. I think this would (if it works) report you the real problem that results in the neon file not being correctly generated.

  • 🇧🇪Belgium Robin.Houtevelts

    I was having the same problem.
    As #5 mentioned, I had a bad vendor/phpstan/extension-installer/src/GeneratedConfig.php.

    In my composer.json I had to enable the phpstan/extension-installer plugin in the allow-plugins section.

    My GeneratedConfig.php file was empty.

    
    namespace PHPStan\ExtensionInstaller;
    
    /**
     * This is a stub class: it is in place only for scenarios where Composer
     * is run with a `--no-scripts` flag, in which scenarios this stub class
     * is not being replaced.
     *
     * If you are reading this docBlock inside your `vendor/` dir, then this means
     * that phpstan/extension-installer didn't correctly install.
     *
     * @internal
     */
    final class GeneratedConfig
    {
    
    	public const EXTENSIONS = [];
    
    	public const NOT_INSTALLED = [];
    
    	public const PHPSTAN_VERSION_CONSTRAINT = null;
    
    	private function __construct()
    	{
    	}
    
    }
    

    After enabling the composer plugin everything works as expected.

  • Pipeline finished with Skipped
    2 months ago
    #312619
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Merged the MR to report the fail from drush so errors are surfaced earlier and in a more useful way.

  • Status changed to Fixed about 2 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024