craftcms / craftcms/cms

[5.x]: OperationAbortedException isn't shown during a codeception run, causing much confusion

Open
#15,519 1 comment 0 reactions 1 assignee View on GitHub

@angrybrad is already working on this.

Since Aug 12, 2024.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

This might be a little niche but it's just cost me an hour of chasing non-existent bugs so even if it's something Google picks up somehow it might be useful.

I'm adding codeception to an existing project. Followed all instructions, but keep getting this sort of error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'craft_test.migrations' doesn't exist

The reason for this error is that the install migration is failing:

https://github.com/craftcms/cms/blob/5.x/src/migrations/Install.php#L77

Because of a schema version mismatch:

Project config validation failed: Craft CMS is Composer-installed with schema version 5.3.0.2, but project.yaml expects 5.0.0.21.

Run `composer install` or remove your `config/project/` folder and try again.

Aborting install.

Obviously this is completely my fault, but would have been good to surface that error and crash out there so I could fix that error.

Steps to reproduce
  1. Update Craft between versions that cause a schemaVersion change
  2. Don't update project config
  3. Try to run tests
Expected behavior

Error about mismatched schemaVersions between project config and installed version

Actual behavior

Error about missing database tables.

Craft CMS version

5.3.2

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.