LaravelCaffeine\Dripper::getAgeThresholdAttribute() error

my Installation stopped working over night, probably issued by daily.sh?

The relevant output of librenms.log:

 [2021-11-13 05:26:02] production.ERROR: Return value of GeneaLabs\LaravelCaffeine\Dripper::getAgeThresholdAttribute() must be of the type int, float returned {"exception":"[object] (TypeError(code: 0): Return value of GeneaLabs\\LaravelCaffeine\\Dripper::getAgeThresholdAttribute() must be of the type int, float returned at /opt/librenms/vendor/genealabs/laravel-caffeine/src/Dripper.php:28)
[stacktrace]
#0 /opt/librenms/vendor/jenssegers/model/src/Model.php(619): GeneaLabs\\LaravelCaffeine\\Dripper->getAgeThresholdAttribute(NULL)
#1 /opt/librenms/vendor/jenssegers/model/src/Model.php(573): Jenssegers\\Model\\Model->mutateAttribute('ageThreshold', NULL)
#2 /opt/librenms/vendor/jenssegers/model/src/Model.php(556): Jenssegers\\Model\\Model->getAttributeValue('ageThreshold')
#3 /opt/librenms/vendor/jenssegers/model/src/Model.php(845): Jenssegers\\Model\\Model->getAttribute('ageThreshold')
#4 /opt/librenms/vendor/genealabs/laravel-caffeine/src/Dripper.php(12): Jenssegers\\Model\\Model->__get('ageThreshold')
#5 /opt/librenms/vendor/jenssegers/model/src/Model.php(619): GeneaLabs\\LaravelCaffeine\\Dripper->getHtmlAttribute(NULL)
#6 /opt/librenms/vendor/jenssegers/model/src/Model.php(573): Jenssegers\\Model\\Model->mutateAttribute('html', NULL)
#7 /opt/librenms/vendor/jenssegers/model/src/Model.php(556): Jenssegers\\Model\\Model->getAttributeValue('html')
#8 /opt/librenms/vendor/jenssegers/model/src/Model.php(845): Jenssegers\\Model\\Model->getAttribute('html')
#9 /opt/librenms/vendor/genealabs/laravel-caffeine/src/Http/Middleware/LaravelCaffeineDripMiddleware.php(45): Jenssegers\\Model\\Model->__get('html')
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): GeneaLabs\\LaravelCaffeine\\Http\\Middleware\\LaravelCaffeineDripMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#14 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#21 /opt/librenms/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#27 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#28 /opt/librenms/html/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#29 {main}
"}

The output of validate.php:

[email protected]:~$ ./validate.php 
====================================
Component | Version
--------- | -------
LibreNMS  | 21.11.0-3-g4b572b9b3
DB Schema | 2021_11_12_123037_change_cpwVcID_to_unsignedInteger (225)
PHP       | 7.3.31-1~deb10u1
Python    | 3.7.3
MySQL     | 10.3.31-MariaDB-0+deb10u1
RRDTool   | 1.7.1
SNMP      | NET-SNMP 5.7.3
====================================

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

Output of git pull and daily.sh:

[email protected]:~$ git pull && ./daily.sh 
Bereits aktuell.
Updating to latest codebase                        OK
Updating Composer packages                         OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK
Caching Mac OUI data                               OK

Sorry for editing, i struggled with preformatted text

Solved it myself…

The issue was this commit: #13505

i manually set the session lifetime back to 120 and everything is working fine now

Hmm, that shouldn’t happen. Probably an upstream bug. I’ll see if I can work around it.

Here is the relevant upstream code:

The only way for it to return a float is if you set your session lifetime to a float. I wonder what is going on. If anyone else is seeing this error, please chime in. Looks like a one off issue to me.

I am using a 32 Bit Linux Distro (Raspbian) could it be the reason?

could be, can you run lnms tinker --execute='dump((43800 - 2) * 60000)'

[email protected]:~$ lnms tinker --execute='dump((43800 - 2) * 60000)'
^ 2627880000.0
[email protected]:~$

A float

I am having the same error, it just started today. I didn’t try the "manually set the session lifetime back to 120 " as I don’t know where or how to do that
Any help getting this going again would be great. I have tried the git pull and ./daily.sh to see if that would help, nothing. Also validate has no errors as well

Took another look and saw the change was made to the /config/session.php file so I applied the same change and I now have a GUI again :slightly_smiling_face:
Yeah!!

Yesterday Librenms was working like a charm, got up this morning and was presented with this page:

Here is my validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 21.11.0-3-g4b572b9b3
DB Schema | 2021_11_12_123037_change_cpwVcID_to_unsignedInteger (225)
PHP | 7.3.31-1~deb10u1
Python | 3.7.3
MySQL | 10.3.31-MariaDB-0+deb10u1
RRDTool | 1.7.1
SNMP | NET-SNMP 5.7.3
====================================

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

And a snippet from librenms.log

2021-11-13 20:05:34] production.ERROR: Return value of GeneaLabs\LaravelCaffeine\Dripper::getAgeThresholdAttribute() must be of the type int, float returned {“userId”:1,“exception”:"[object] (TypeError(code: 0): Return value of GeneaLabs\LaravelCaffeine\Dripper::getAgeThresholdAttribute() must be of the type int, float returned at /opt/librenms/vendor/genealabs/laravel-caffeine/src/Dripper.php:28)
[stacktrace]
#0 /opt/librenms/vendor/jenssegers/model/src/Model.php(619): GeneaLabs\LaravelCaffeine\Dripper->getAgeThresholdAttribute(NULL)
#1 /opt/librenms/vendor/jenssegers/model/src/Model.php(573): Jenssegers\Model\Model->mutateAttribute(‘ageThreshold’, NULL)
#2 /opt/librenms/vendor/jenssegers/model/src/Model.php(556): Jenssegers\Model\Model->getAttributeValue(‘ageThreshold’)
#3 /opt/librenms/vendor/jenssegers/model/src/Model.php(845): Jenssegers\Model\Model->getAttribute(‘ageThreshold’)
#4 /opt/librenms/vendor/genealabs/laravel-caffeine/src/Dripper.php(12): Jenssegers\Model\Model->__get(‘ageThreshold’)
#5 /opt/librenms/vendor/jenssegers/model/src/Model.php(619): GeneaLabs\LaravelCaffeine\Dripper->getHtmlAttribute(NULL)
#6 /opt/librenms/vendor/jenssegers/model/src/Model.php(573): Jenssegers\Model\Model->mutateAttribute(‘html’, NULL)
#7 /opt/librenms/vendor/jenssegers/model/src/Model.php(556): Jenssegers\Model\Model->getAttributeValue(‘html’)
#8 /opt/librenms/vendor/jenssegers/model/src/Model.php(845): Jenssegers\Model\Model->getAttribute(‘html’)
#9 /opt/librenms/vendor/genealabs/laravel-caffeine/src/Http/Middleware/LaravelCaffeineDripMiddleware.php(45): Jenssegers\Model\Model->__get(‘html’)
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): GeneaLabs\LaravelCaffeine\Http\Middleware\LaravelCaffeineDripMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /opt/librenms/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#28 /opt/librenms/html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#29 {main}
"}
/opt/librenms/discovery.php new 2021-11-13 20:10:02 - 0 devices discovered in 0.013 secs
/opt/librenms/poller.php 5 2021-11-13 20:10:10 - 1 devices polled in 5.608 secs
/opt/librenms/poller.php 4 2021-11-13 20:10:10 - 1 devices polled in 5.533 secs
/opt/librenms/poller.php 17 2021-11-13 20:10:11 - 1 devices polled in 5.820 secs
/opt/librenms/poller.php 14 2021-11-13 20:10:11 - 1 devices polled in 5.815 secs
/opt/librenms/poller.php 3 2021-11-13 20:10:11 - 1 devices polled in 5.787 secs
/opt/librenms/poller.php 1 2021-11-13 20:10:11 - 1 devices polled in 6.343 secs
/opt/librenms/poller.php 15 2021-11-13 20:10:11 - 1 devices polled in 6.149 secs
/opt/librenms/poller.php 2 2021-11-13 20:10:11 - 1 devices polled in 6.188 secs
/opt/librenms/poller.php 16 2021-11-13 20:10:13 - 1 devices polled in 8.250 secs
/opt/librenms/poller.php 7 2021-11-13 20:10:16 - 1 devices polled in 11.48 secs
/opt/librenms/poller.php 6 2021-11-13 20:10:17 - 1 devices polled in 12.02 secs

The librenms is running on rasbian with the latest stable as far as I know.
So, what should I do? I think daily.sh runs by it self every now and then as well.

1 Like

Same here. .validate and .daily working but GUI down. On an up-to date Rasberry Pi OS (Buster). Pollers still collecting data without issue since RRD graphs can be viewed outside of the LibreNMS GUI.

+1
Raspi 3B with LibreNMS 21.11.04
Git up-2-date
Nothing in the logs
Validate and daily both runs without any errors

@Raspbianuser @daand @Anders_Ostling I’ve moved your posts to another thread.

Check up to see a possible solution.

Another voice to the choir; LibreNMS stopped working overnight.

A little digging suggests the problem is that the default value of session.lifetime is 43800, which is getting multiplied by 60000 in the Dipper code, putting it outside the bounds of an integer.

It looks like one side or the other has changed the interpretation of that value from seconds to minutes, or vice versa. I’ve not dug through the revision history to figure out which one it is.

A quick fix seems to be setting SESSION_LIFETIME in your .env file to something that Dripper accepts, like its default value of 32.

Thanks, got it working again! :slight_smile:

“35793” is the maximum value you can set on a 32bit PI. I did that in my .env file:

SESSION_LIFETIME=35793

and everything is working again.

1 Like

Still baffled by this. Integer overflow = return float??? Crazy stuff there PHP… PHP: Integers - Manual

Thanks for checking out the max @Talkabout I will change the default to 24 days (34560).

Same problem at my side :frowning:
Librenms worked like a charm until yesterday (13/11) morning on a Raspberry.

Error in librenms.log
[2021-11-14 15:17:13] production.ERROR: Return value of GeneaLabs\LaravelCaffeine\Dripper::getAgeThresholdAttribute() must be of the type int, float returned {“exception”:"[object] (TypeError(code: 0): Return value of GeneaLabs\LaravelCaffeine\Dripper::getAgeThresholdAttribute() must be of the type int, float returned at /opt/librenms/vendor/genealabs/laravel-caffeine/src/Dripper.php:28)

validate is Ok, daily works, poller works but is GUI down!

Ok problem solved :wink:
Added SESSION_LIFETIME=35793 to /opt/librenms/.env
GUI works again.

Thx to the Great Spirits!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.