Backfill contact addresses (label=HomeAddress) Welcome to Grease Ducks CRM
Internal Server Error

Illuminate\Database\QueryException

vendor/laravel/framework/src/Illuminate/Database/Connection.php:824

SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'grease_crmapp'@'localhost' for table `elyx_my_gd`.`gd_contacts` (Connection: mysql, SQL: select * from `elyx_my_gd`.`gd_contacts` where `id` = 6 limit 1)

LARAVEL 12.35.1
PHP 8.2.30
UNHANDLED
CODE 42000
500
GET
https://my.elyx.ca

Exception trace

8 vendor frames
Illuminate\Database\Connection->runQueryCallback(string, array, object(Closure))
vendor/laravel/framework/src/Illuminate/Database/Connection.php:824
Illuminate\Database\Connection->run(string, array, object(Closure))
vendor/laravel/framework/src/Illuminate/Database/Connection.php:778
Illuminate\Database\Connection->select(string, array, boolean)
vendor/laravel/framework/src/Illuminate/Database/Connection.php:397
Illuminate\Database\Query\Builder->runSelect()
vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3188
Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3173
Illuminate\Database\Query\Builder->onceWithColumns(array, object(Closure))
vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3763
Illuminate\Database\Query\Builder->get(array)
vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3172
Illuminate\Database\Concerns\BuildsQueries->first()
vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:366
scripts/backfill-contact-addresses.php
scripts/backfill-contact-addresses.php:51
4647          if ($legacyId > 0) {48              $legacy = DB::connection('mysql')49                  ->table($legacyDb . '.gd_contacts')50                  ->where('id', $legacyId)51                  ->first();52          }5354          if (!$legacy && $email !== '') {55              $legacy = DB::connection('mysql')56                  ->table($legacyDb . '.gd_contacts')57                  ->where('email', $email)58                  ->first();59          }6061          if (!$legacy) {62              $skipped++;63
2 vendor frames
Illuminate\Database\Concerns\BuildsQueries->orderedChunkById(integer, object(Closure), string, string)
vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:207
Illuminate\Database\Concerns\BuildsQueries->chunkById(integer, object(Closure))
vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:133
scripts/backfill-contact-addresses.php
scripts/backfill-contact-addresses.php:33
2829DB::connection('mysql')30  ->table('contacts')31  ->select(['id', 'email', $hasLegacyId ? 'legacy_id' : DB::raw('NULL as legacy_id')])32  ->orderBy('id')33  ->chunkById(500, function ($rows) use (34      $legacyDb, $newDb, $label,35      &$total, &$inserted, &$updated, &$skipped, $hasLegacyId36  ) {37      foreach ($rows as $c) {38          $total++;3940          $contactId = (int) $c->id;41          $legacyId  = $hasLegacyId ? (int) ($c->legacy_id ?? 0) : 0;42          $email     = trim((string) ($c->email ?? ''));4344          // Find legacy contact row45

Queries

mysql
select column_name as `name`, data_type as `type_name`, column_type as `type`, collation_name as `collation`, is_nullable as `nullable`, column_default as `default`, column_comment as `comment`, generation_expression as `expression`, extra as `extra` from information_schema.columns where table_schema = schema() and table_name = 'contacts' order by ordinal_position asc
2.06ms
mysql
select `id`, `email`, `legacy_id` from `contacts` where `id` is not null order by `id` asc limit 500
0.46ms

Headers

host
my.elyx.ca
user-agent
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
accept
*/*
accept-language
en-us,en;q=0.5
accept-charset
ISO-8859-1,utf-8;q=0.7,*;q=0.7
x-https
1
connection
Keep-Alive
x-forwarded-for
216.73.216.149
x-forwarded-proto
https
cf-visitor
{"scheme":"https"}
cf-ipcountry
US
cdn-loop
cloudflare; loops=1
accept-encoding
gzip, br
cf-ray
9e0087607c558305-CMH

Body

// No request body

Routing

// No routing context

Routing parameters

// No routing parameters