Postgres error 500 on paths when supplied entity ID gte 2147483647 and lte 9223372036854776832

Created on 16 December 2022, over 2 years ago
Updated 16 May 2023, almost 2 years ago

Problem/Motivation

Passing an entity ID between 2147483648 and 9223372036854776832 can cause an error 500 on Postgres. Higher or lower IDs return a 404 as expected.

I wasn't able to reproduce this when testing with sqlite or mysql.

Steps to reproduce

Visit any of the following error URLs to validate a Postgres DB backend.

  • /node/9223372036854776833 (404 shown, correct behaviour)
  • /node/9223372036854776832 (500 error, incorrect)
  • /node/2147483648 (500 error, incorrect)
  • /node/2147483647 (404, correct)
  • /taxonomy/term/99999999999999999 (500 error, incorrect)
  • /user/99999999999999999 (500 error, incorrect)

Expected behaviour is a 404 for missing node.

Incorrect behaviour (IMO) is an error 500.

database=# select version();
 PostgreSQL 12.9 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

AFAICT Postgres 64-bit is matched here with 64-bit webserver.

I'm using lando/drupal-contributions to test locally:

# MySQL passes
SIMPLETEST_DB=mysql://drupal9:drupal9@database/drupal9 php /app/web/vendor/bin/phpunit -c /app/phpunit.xml  web/core/tests/Drupal/FunctionalTests/Routing --filter EntityIdValidationTest

# SQLite passes
SIMPLETEST_DB=sqlite://tmp/test.sqlite php /app/web/vendor/bin/phpunit -c /app/phpunit.xml  web/core/tests/Drupal/FunctionalTests/Routing --filter EntityIdValidationTest

# Postgres fails
SIMPLETEST_DB=pgsql://postgres:postgres@postgres:5432/database php /app/web/vendor/bin/phpunit -c /app/phpunit.xml  web/core/tests/Drupal/FunctionalTests/Routing --filter EntityIdValidationTest

Child of 🌱 [meta] Remaining Drupal 10/11 PostgreSQL issues Active .

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs review

Version

10.1 ✨

Component
PostgreSQL driverΒ  β†’

Last updated 11 days ago

No maintainer
Created by

πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

Live updates comments and jobs are added and updated live.
  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

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.

Production build 0.71.5 2024