Broken installation and tracking on PostgreSQL

Created on 14 July 2022, almost 3 years ago
Updated 21 May 2025, 19 days ago

Hi.

The installation of advertisement 4.0.0.beta2 on a site with drupal 9.4.3 and PostgreSQL 13 makes the whole site malfunction ("The website encountered an unexpected error. Please try again later.").
The error in the status report is:
===
Entity / field definitions
Mismatched entity and / or field definitions
The following changes were detected in the entity type and field definitions.
AD Track Event
The AD Track Event entity type needs to be installed.
===
Trying an entity update with drush the result is:

$ vendor/bin/drush upe
The following updates are pending: ad_track_event entity type : The AD Track Event entity type needs to be installed.. Do you wish to run all pending updates? (yes/no) [yes]: > yes In SqlContentEntityStorage.php line 1592: Exception thrown while performing a schema update. SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: name >= integer
LINE 5: "user" bigint CHECK (user >= 0) NULL, ^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.: CREATE TABLE "drupal_ad_track_event" (
"id" bigserial CHECK (id >= 0), "type" varchar(255) NOT NULL, "uuid" varchar(128) NOT NULL, "user" bigint CHECK (user >= 0) NULL, "created" int NULL, "ad_id" varchar(255) NULL, "ip_address" varchar(255) NULL, "user_agent" text NULL, "url" text NULL, "page_title" text NULL, "referrer" text NULL, "page_view_id" varchar(255) NULL, "session" varchar(255) NULL, "parent_id" varchar(255) NULL, CONSTRAINT drupal_ad_track_event____pkey PRIMARY KEY ("id"), CONSTRAINT drupal_ad_track_event__ad_track_event_field__uuid__value__key UNIQUE (uuid) ); Array ( )
In ExceptionHandler.php line 79: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: name >= integer LINE 5: "user" bigint CHECK (user >= 0) NULL, ^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.: CREATE TABLE "drupal_ad_track_event" (
"id" bigserial CHECK (id >= 0), "type" varchar(255) NOT NULL, "uuid" varchar(128) NOT NULL, "user" bigint CHECK (user >= 0) NULL, "created" int NULL, "ad_id" varchar(255) NULL, "ip_address" varchar(255) NULL, "user_agent" text NULL, "url" text NULL, "page_title" text NULL, "referrer" text NULL, "page_view_id" varchar(255) NULL, "session" varchar(255) NULL, "parent_id" varchar(255) NULL, CONSTRAINT drupal_ad_track_event____pkey PRIMARY KEY ("id"), CONSTRAINT drupal_ad_track_event__ad_track_event_field__uuid__value__key UNIQUE (uuid) ); Array ( ) In StatementWrapper.php line 145: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: name >= integer LINE 5: "user" bigint CHECK (user >= 0) NULL, ^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
===

Uninstalling the module with composer or drush does not solve the problem and neither does the reinstallation.

After removal if you try an updatedb with drush you will get the following error:

$ vendor/bin/drush updatedb [error] (Currently using Missing or invalid modules The following modules are marked as installed in the core.extension configuration, but they are missing: * ad * ad_content * ad_track Review the suggestions for resolving this incompatibility [1] to repair your installation, and then re-run update.php. [1] https://www.drupal.org/docs/8/update/troubleshooting-database-updates )
===

After removal, the status reports this error:

Entity/field definitions
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
AD Content
The Total impressions field needs to be uninstalled.
The Total clicks field needs to be uninstalled.
AD Track Event
The AD Track Event entity type needs to be installed.
===

With the module installed the admin page for uninstalling the modules (example.com//admin/modules/uninstall) no longer works, in the log the error (php type) looks like this:
===
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "drupal_ad_track_event" does not exist LINE 3: "drupal_ad_track_event" "base_table" ^: SELECT "base_table"."id" AS "id", "base_table"."id" AS "base_table_id" FROM "drupal_ad_track_event" "base_table" LIMIT 1 OFFSET 0; Array ( ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 271 of /example.com/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
===

I haven't been able to find a solution yet.

Thanks

🐛 Bug report
Status

Closed: outdated

Version

4.0

Component

installation

Created by

🇮🇹Italy logos_apeiron

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    Please retry with 11.0 rewrite, once released. If there are still issues, please reopen or create a new issue with details.

    Thank you!

Production build 0.71.5 2024