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

DB connection error when opening admin/translation-manager page #26

Open
ggll11ii opened this issue Nov 27, 2024 · 2 comments
Open

DB connection error when opening admin/translation-manager page #26

ggll11ii opened this issue Nov 27, 2024 · 2 comments

Comments

@ggll11ii
Copy link

Bug report

What I did

I followed the installation on https://github.com/Laravel-Backpack/translation-manager
composer require backpack/translation-manager
php artisan vendor:publish --provider="Spatie\TranslationLoader\TranslationServiceProvider" --tag="migrations"
php artisan migrate
php artisan backpack:add-menu-content "<x-backpack::menu-item title="Translation Manager" icon="la la-stream" :link="backpack_url('translation-manager')" />"
php artisan vendor:publish --provider="Spatie\TranslationLoader\TranslationServiceProvider" --tag="config"
php artisan vendor:publish --provider="Backpack\TranslationManager\AddonServiceProvider" --tag="config"

What I expected to happen

I want to see the /admin/translation-manager page from the admin panel

What happened

When I accessed /admin/translation-manager page, I got
could not find driver (Connection: , SQL: create table "language_lines" ("id" varchar, "id_database" integer, "database" tinyint(1), "group" varchar, "key" varchar, "text" varchar, "created_at" date, "search" varchar))

What I've already tried to fix it

I can see /admin/user page, so I think the database connection works well.

Context to replicate the bug - Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

8.3.8

PHP EXTENSIONS:

Core, bcmath, calendar, ctype, date, filter, hash, iconv, json, SPL, pcre, random, readline, Reflection, session, standard, mysqlnd, tokenizer, zlib, libxml, dom, PDO, openssl, SimpleXML, xml, xmlreader, xmlwriter, Phar, curl, oci8, fileinfo, zip, mysqli, pdo_mysql, gd, mbstring

LARAVEL VERSION:

11.28.1.0

BACKPACK PACKAGE VERSIONS:

backpack/basset: 1.3.6
backpack/crud: 6.7.42
backpack/generators: v4.0.7
backpack/language-switcher: 2.0.0
backpack/theme-tabler: 1.2.15
backpack/translation-manager: 1.0.4

Copy link

Based on the information provided, it appears you're encountering a database connection error when trying to access the translation manager page in Backpack. Let's analyze the issue:

  1. The error message suggests that the database driver could not be found. This is often related to missing PHP extensions or incorrect database configuration.

  2. You mentioned that you can see the /admin/user page, which indicates that the main database connection for Backpack is working correctly.

  3. The error occurs specifically when trying to create the "language_lines" table, which is part of the translation manager package.

Here are some potential solutions to try:

  1. Check your database configuration:
    Make sure that the database connection settings in your .env file are correct for the translation manager. It's possible that the translation manager is using a different connection than your main Backpack installation.

  2. Verify PHP extensions:
    Ensure that the necessary PHP extensions for your database are installed and enabled. Based on the error message, it seems you might be using SQLite (as the error mentions creating a table with a "varchar" primary key). Make sure the SQLite extension is installed and enabled in your PHP configuration.

  3. Check the translation manager configuration:
    Review the configuration file for the translation manager (likely config/translation-loader.php) and ensure that the database connection settings are correct.

  4. Run migrations specifically for the translation manager:
    Try running the migrations specifically for the translation manager package:

    php artisan migrate --path=vendor/backpack/translation-manager/database/migrations
    
  5. Clear config cache:
    Sometimes, cached configurations can cause issues. Try clearing the config cache:

    php artisan config:clear
    

If none of these solutions work, you may want to check the Backpack Translation Manager GitHub issues to see if there are any known issues or additional troubleshooting steps for your specific setup.

If the problem persists, you might need to provide more detailed information about your database setup and any custom configurations you've made to get more specific help.

ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️

Relevant sources:

Github Issue (closed): [Bug] Method Illuminate\Database\PostgresConnection::getDoctrineColumn does not exist
Github Issue (closed): [Feature Request] Remote database connection gives error on Backpack Admin
Github Issue (closed): Installation does not work with SQLSRV
Github Issue (closed): Backpack admin panel with firebase
After installing I get ERROR 500. Can´t find the issue
Github Issue (closed): Deploy Backpack for Laravel in production
Github Issue (closed): [Bug]
Github Issue (closed): [Bug] Backpack doesn't work with nginx in docker
Bug report
Github Issue (closed): Class 'Composer\InstalledVersions' not found
Github Issue (closed): [Bug] Installation freezes on SQLite
Github Issue (closed): [Bug] 419 PAGE EXPIRED when I try to login through 127.0.0.1:8000/admin/login
Github Issue (closed): ReflectionException Class translator does not exist
Github Issue (closed): Searching a table in Arabic language shows error [Bug]
Installation error

@ggll11ii
Copy link
Author

  1. I'm using mysql.
  2. When I ran php artisan migrate --path=vendor/backpack/translation-manager/database/migrations, I got Nothing to migrate.

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

1 participant