Drush command to rebuild location data fails with unknown column location_postal_code error

Created on 6 June 2024, 7 months ago
Updated 28 June 2024, 6 months ago

Problem/Motivation

Heartened to see it was getting geocode data from IPs, was expecting to be filing an issue asking for documentation/support on how to know if the Maxmind database, GeoLite2-City.mmdb, was indeed placed such that it could be successfully used. That was the fortunately. But unfortunately:

drush visitors:rebuild:location
There are 1 locations to process.
 1/1 [============================] 100% < 1 sec/< 1 sec 40.5 MiB
In ExceptionHandler.php line 56:
                                                                                                                                                                                                                                                            
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'location_postal_code' in 'field list': UPDATE "visitors" SET "location_continent_code"=:db_update_placeholder_0, "location_country_code"=:db_update_placeholder_1, "location_country_name"=:db_u  
  pdate_placeholder_2, "location_region"=:db_update_placeholder_3, "location_city"=:db_update_placeholder_4, "location_postal_code"=:db_update_placeholder_5, "location_latitude"=:db_update_placeholder_6, "location_longitude"=:db_update_placeholder_7,  
   "location_area_code"=:db_update_placeholder_8                                                                                                                                                                                                            
  WHERE ("visitors_ip" = :db_condition_placeholder_0) AND ("location_latitude" IS NULL); Array                                                                                                                                                              
  (                                                                                                                                                                                                                                                         
      [:db_update_placeholder_0] => NA                                                                                                                                                                                                                      
      [:db_update_placeholder_1] => US                                                                                                                                                                                                                      
      [:db_update_placeholder_2] => United States                                                                                                                                                                                                           
      [:db_update_placeholder_3] => MA                                                                                                                                                                                                                      
      [:db_update_placeholder_4] => Natick                                                                                                                                                                                                                  
      [:db_update_placeholder_5] => 01760                                                                                                                                                                                                                   
      [:db_update_placeholder_6] => 42.2878                                                                                                                                                                                                                 
      [:db_update_placeholder_7] => -71.3587                                                                                                                                                                                                                
      [:db_update_placeholder_8] => 506                                                                                                                                                                                                                     
      [:db_condition_placeholder_0] => 209.6.29.9                                                                                                                                                                                                           
  )                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                            
In StatementWrapperIterator.php line 111:
                                                                                                 
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'location_postal_code' in 'field list'  

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

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