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

unable to connect to database: Access denied for user 'pf'@'localhost' #8165

Open
JeGoi opened this issue May 28, 2024 · 3 comments
Open

unable to connect to database: Access denied for user 'pf'@'localhost' #8165

JeGoi opened this issue May 28, 2024 · 3 comments

Comments

@JeGoi
Copy link
Contributor

JeGoi commented May 28, 2024

Describe the bug

2024-05-28T13:06:45.553212+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Hard expiring resource : config::Roles() (pfconfig::manager::expire)
2024-05-28T13:06:45.556461+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Connecting to MySQL database (pfconfig::backend::mysql::_get_db)
2024-05-28T13:06:45.567285+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Expiring child resource resource::RolesReverseLookup. Master resource is config::Roles() (pfconfig::manager::expire)
2024-05-28T13:06:45.567388+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Hard expiring resource : resource::RolesReverseLookup() (pfconfig::manager::expire)
2024-05-28T13:06:45.612272+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] commiting via Roles configstore (pf::ConfigStore::Roles::commit)
2024-05-28T13:06:45.622480+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID voice (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.623582+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID User (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.624414+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID default (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.625630+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID REJECT (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.626677+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID cvxfc (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.627737+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID Machine (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.628788+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID guest (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.629672+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID dzfbxdgbxfg (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.630589+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID gaming (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.631661+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) INFO: [mac:[undef]] Inserting/updating role with ID dgs (pf::nodecategory::nodecategory_upsert)
2024-05-28T13:06:45.643117+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) FATAL: [mac:[undef]] unable to connect to database: Access denied for user 'pf'@'localhost' (using password: YES) at /usr/local/pf/lib/CHI/Driver/DBI.pm line 28.
2024-05-28T13:06:45.644530+00:00 139-144-205-253 pfperl-api-docker-wrapper[187846]: pfperl-api(14) ERROR: [mac:[undef]] unable to connect to database: Access denied for user 'pf'@'localhost' (using password: YES) at /usr/local/pf/lib/CHI/Driver/DBI.pm line 28.

https://github.com/inverse-inc/packetfence/blob/feature/debian12/lib/CHI/Driver/DBI.pm#L28

To Reproduce
Steps to reproduce the behavior:

  1. install pf on debian12
  2. Try to add something

Expected behavior
Do not have mysql issue.

Additional context
Try to add by hand:

GRANT CREATE,ALTER ON pf.* TO 'pf'@'localhost';
FLUSH PRIVILEGES;

Looks fine on cli, but still failing

@JeGoi
Copy link
Contributor Author

JeGoi commented May 28, 2024

Weird...

mysql -u $(perl -I/usr/local/pf/lib_perl/lib/perl5 -I/usr/local/pf/lib -Mpf::db -e 'print $pf::db::DB_Config->{user}') -p$(perl -I/usr/local/pf/lib_perl/lib/perl5 -I/usr/local/pf/lib -Mpf::db -e 'print $pf::db::DB_Config->{pass}') -h $(perl -I/usr/local/pf/lib_perl/lib/perl5 -I/usr/local/pf/lib -Mpf::db -e 'print $pf::db::DB_Config->{host}') pf
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Document.pm line 75.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 376.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 875.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 894.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Document.pm line 75.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 376.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 875.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 894.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Document.pm line 75.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 376.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 875.
each on anonymous hash will always start from the beginning at /usr/local/pf/lib_perl/lib/perl5/x86_64-linux-gnu-thread-multi/Template/Provider.pm line 894.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 44
Server version: 10.11.6-MariaDB-0+deb12u1 Debian 12

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [pf]>

@JeGoi JeGoi added this to the PacketFence-14.0 milestone May 30, 2024
@JeGoi
Copy link
Contributor Author

JeGoi commented May 31, 2024

related to #8144
Fixed by restarting services

@satkunas
Copy link
Contributor

@jrouzierinverse fixed in deb11 or not?

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

No branches or pull requests

3 participants