andrewdwallo / transmatic

Automate and streamline real-time text translations in your Laravel applications
MIT License
41 stars 5 forks source link

Error: Base table not found (missing migrations) #13

Closed sitenzo closed 8 months ago

sitenzo commented 8 months ago

Package Version

1.0.5

PHP Version

8.1.6

Laravel Version

10.38.1

Which operating system do you use?

None

Translation Service

AWS Translate

Environment Details

Windows with PHP Storm

Problem Description

Error in logs with no translations generated

Failed to dispatch translation batch: {"locale":"nl","exception":"SQLSTATE[42S02]: Base table or view not found: 1146 Table '****.job_batches' doesn't exist (Connection: mysql, SQL: insert into `job_batches` (`id`, `name`, `total_jobs`, `pending_jobs`, `failed_jobs`, `failed_job_ids`, `options`, `created_at`, `cancelled_at`, `finished_at`) values (9ae7a0e5-a324-4044-b867-11766ac8bcd3, TransmaticBatch, 0, 0, 0, [], a:5:{s:10:\"connection\";s:8:\"database\";s:5:\"queue\";s:12:\"translations\";s:13:\"allowFailures\";b:1;s:5:\"catch\";a:1:{i:0;O:47:\"Laravel\\SerializableClosure\\SerializableClosure\":1:{s:12:\"serializable\";O:46:\"Laravel\\SerializableClosure\\Serializers\\Signed\":2:{s:12:\"serializable\";s:587:\"O:46:\"Laravel\\SerializableClosure\\Serializers\\Native\":5:{s:3:\"use\";a:1:{s:2:\"to\";s:2:\"nl\";}s:8:\"function\";s:345:\"function (\\Illuminate\\Bus\\Batch $batch, \\Throwable $e) use ($to) {
                    \\Illuminate\\Support\\Facades\\Log::error('Translation batch failed:', [
                        'batchId' => $batch->id,
                        'locale' => $to,
                        'exception' => $e->getMessage(),
                    ]);
                }\";s:5:\"scope\";s:42:\"Wallo\\Transmatic\\Services\\TranslateService\";s:4:\"this\";N;s:4:\"self\";s:32:\"0000000000000b730000000000000000\";}\";s:4:\"hash\";s:44:\"h5WgT64sSxvzYbaIM3fWf74Oyy+9kR4HydC8xiv8cGQ=\";}}}s:7:\"finally\";a:1:{i:0;O:47:\"Laravel\\SerializableClosure\\SerializableClosure\":1:{s:12:\"serializable\";O:46:\"Laravel\\SerializableClosure\\Serializers\\Signed\":2:{s:12:\"serializable\";s:540:\"O:46:\"Laravel\\SerializableClosure\\Serializers\\Native\":5:{s:3:\"use\";a:2:{s:18:\"translationHandler\";O:49:\"Wallo\\Transmatic\\Services\\Translation\\FileHandler\":2:{s:11:\"\u0000*\u0000filePath\";s:4:\"lang\";s:15:\"\u0000*\u0000checkedFiles\";a:2:{s:2:\"en\";b:1;s:2:\"nl\";b:1;}}s:2:\"to\";s:2:\"nl\";}s:8:\"function\";s:126:\"function () use ($translationHandler, $to) {
                    $translationHandler->setBatchFinished($to);
                }\";s:5:\"scope\";s:42:\"Wallo\\Transmatic\\Services\\TranslateService\";s:4:\"this\";N;s:4:\"self\";s:32:\"0000000000000b790000000000000000\";}\";s:4:\"hash\";s:44:\"VmKO9tSBawDGRLMlkJZozjBw1QAsbuvNufhDMKhi6h4=\";}}}}, 1703196275, ?, ?))"} 

Expected Behavior

No error, with migrations in package

Steps To Reproduce

install latest version and translate. I dont know when it goes to database but if it goes to database it fails because of missing migrations

Notes

No response

andrewdwallo commented 8 months ago

The package uses Laravel Jobs along with Job Batching to help with Translation load. Without it, translation processing would take forever. This needs to be added to the documentation I suppose. I will do this shortly.

andrewdwallo commented 8 months ago

Documentation updated in new release v1.0.6