antonioribeiro / antonioribeiro/tracker

Error in Laravel 8 migration problem, There is no active transaction

Open
#532 13 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
2.9k
Forks
594
PR merge metrics
No merged PRs in 30d

Description

after installing this package and define settings into `app/config.php` and publishing configuration, when i try to run this command:
```
php artisan migrate:fresh
```
i get error after this part of `readme` install document

```
Migrate it

If you have set the default connection to tracker, you can:
php artisan migrate

```

Error:

```
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table (43.99ms)
Migrating: 2015_03_07_311070_create_tracker_paths_table

PDOException

There is no active transaction

at vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:189
185▕ */
186▕ public function commit()
187▕ {
188▕ if ($this->transactions == 1) {
➜ 189▕ $this->getPdo()->commit();
190▕
191▕ optional($this->transactionsManager)->commit($this->getName());
192▕ }
193▕

+35 vendor frames
36 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
```

I'm using `Docker` as `LaraDock` and this is my `database` file content:

```php
env('DB_CONNECTION', 'mariadb'),

'connections' => [

///
'tracker' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'mariadb'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'strict' => false,
'collation' => 'utf8mb4_persian_ci',
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'mariadb'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_persian_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],

///

'laravel-visits' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 3, // anything from 1 to 15, except 0 (or what is set in default)
],

],
'migrations' => 'migrations',

/

///

],

];
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the README migration instructions and reproduce `php artisan migrate:fresh` using the provided Laravel database configuration and LaraDock environment. Trace the failure from `vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php` and the `2015_03_07_311070_create_tracker_paths_table` migration; done means the migration completes without the transaction error.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.