Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migate success with error #298

Closed
futag opened this issue Nov 23, 2020 · 5 comments
Closed

Migate success with error #298

futag opened this issue Nov 23, 2020 · 5 comments

Comments

@futag
Copy link

futag commented Nov 23, 2020

if migrating myth auth using php spark migrate -all showing error like this

`An uncaught Exception was encountered

Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: C:\xampp\htdocs\1cak-new\vendor\codeigniter4\framework\system\Database\BaseConnection.php
Line Number: 425`

and env is correct

@cseoneohs
Copy link

Hello, i have exactly the same problem.

@cseoneohs
Copy link

In fact the tables had been created ! But still have the message "An uncaught Exception was encountered...

@sandrocantagallo
Copy link

So...

Short answer:

in your PHP.ini check for:

extension=sqlite3

You need this library in codeigniter 4 in order to use FORGE.

Long answer:

Open: app\Config\Logger.php

Set to 9 logging level

/*
	|--------------------------------------------------------------------------
	| Error Logging Threshold
	|--------------------------------------------------------------------------
	|
	| You can enable error logging by setting a threshold over zero. The
	| threshold determines what gets logged. Any values below or equal to the
	| threshold will be logged. Threshold options are:
	|
	|	0 = Disables logging, Error logging TURNED OFF
	|	1 = Emergency Messages  - System is unusable
	|	2 = Alert Messages      - Action Must Be Taken Immediately
	|   3 = Critical Messages   - Application component unavailable, unexpected exception.
	|   4 = Runtime Errors      - Don't need immediate action, but should be monitored.
	|   5 = Warnings               - Exceptional occurrences that are not errors.
	|   6 = Notices            - Normal but significant events.
	|   7 = Info             - Interesting events, like user logging in, etc.
	|   8 = Debug                - Detailed debug information.
	|   9 = All Messages
	|
	| You can also pass an array with threshold levels to show individual error types
	|
	| 	array(1, 2, 3, 8) = Emergency, Alert, Critical, and Debug messages
	|
	| For a live site you'll usually enable Critical or higher (3) to be logged otherwise
	| your log files will fill up very fast.
	|
	*/
	public $threshold = 9;

Now redo migration...and go to:

writable\logs

for see logs. You will find in the last log:

ERROR - 2020-11-25 23:27:39 --> Error connecting to the database: Class 'SQLite3' not found
CRITICAL - 2020-11-25 23:27:39 --> Unable to connect to the database.

If you active the library and redo migration you will see something like:

Running all new migrations...
Running: (Myth\Auth) 2017-11-20-223112_Myth\Auth\Database\Migrations\CreateAuthTables
Done

AfterAll this error don't block the library and table in DB are saved.

@MGatner
Copy link
Collaborator

MGatner commented Jan 4, 2021

This is not a Myth issue. If sandrocantagallo 's fix does not work for you check this thread for solutions: codeigniter4/CodeIgniter4#3359

If the problem persists please add to that thread or open a new issue at the framework's repo.

@lonnieezell this can close.

@MGatner
Copy link
Collaborator

MGatner commented Jan 14, 2021

@lonnieezell bump closure request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants