Unable to use http-auth since update to laravel auth

We have a few librenms installations that leverage the use of http-auth in order to allow existing apache users to log into librenms.

After the auto update last night all installs produce the following error:

Unhandled MySQL Error [23000] SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' cannot be null

I’ve checked the http-auth on the cli as OK

librenms@monitor:~$ ./scripts/auth_test.php -u sparkkeh
Authentication Method: http-auth
Password:
Authenticate user sparkkeh:
AUTH SUCCESS

User (1):
  user_id => 1
  auth_type =>
  auth_id => 1
  username => librenms-admin
  realname =>
  email => [email protected]
  descr =>
  level => 10
  can_modify_passwd => 1
  created_at => 1970-01-02 00:00:01
  updated_at => 2018-04-03 20:53:26
librenms@monitor:~$
====================================
Component | Version
--------- | -------
LibreNMS  | 1.43-46-g32a7c50
DB Schema | 267
PHP       | 7.0.28-0ubuntu0.16.04.1
MySQL     | 5.7.21-0ubuntu0.16.04.1
RRDTool   | 1.5.5
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.7.2
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct

For the moment I have commented out the http-auth portion of config.php in order to log in again.

I’ve run Laravel in debug mode and got more info.

Unhandled MySQL Error [23000] SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' cannot be null (SQL: insert into `users` (`descr`, `realname`, `email`, `can_modify_passwd`, `username`, `auth_id`, `level`, `auth_type`, `updated_at`, `created_at`) values (, , [email protected], 1, , 1, 10, http-auth, 2018-09-12 10:31:16, 2018-09-12 10:31:16))

In order to log via http-auth with my user, I ran the SQL manually:

insert into `users` (`email`, `can_modify_passwd`, `username`, `auth_id`, `level`, `auth_type`, `updated_at`, `created_at`) values ('[email protected]', 1, 'sparkkeh', 1, 10, 'http-auth', '2018-09-12 10:21:04', '2018-09-12 10:21:04');

Looks like last few commits have fixed this issue after running ./daily.sh

1 Like