Postgres:DatabaseExceptionWrapper: Exception in Visitors[visitors]: SQLSTATE[42601]: Syntax error

Created on 5 December 2024, 18 days ago

Problem/Motivation

The url "/visitors/times" Generates the message: The website encountered an unexpected error. Try again later.
With the following log message in the log:

Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Visitors[visitors]: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "AS" LINE 1: SELECT AS "visitors_day", COUNT(DISTINCT visitors.visitor_i... ^: SELECT AS "visitors_day", COUNT(DISTINCT visitors.visitor_id) AS "visitors_visitor_id" FROM "visitors" "visitors" WHERE ("visitors"."bot" <> :db_condition_placeholder_0) AND ((visitors.visitors_date_time BETWEEN 1733032800 AND 1735711200)) GROUP BY "visitors_day"; Array ( [:db_condition_placeholder_0] => 1 ) in main() (line 19 of /opt/drupal/web/index.php).

Steps to reproduce

  1. Drupal 11
  2. Postgres 16
  3. Visitors module installed and enabled (without GEO IP at the moment)
  4. Visit the url: /visitors/times

There are other sql syntax errors.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.21

Component

Code

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024