Laravel-log-viewer: Daily storage logs not working for lumen 5.5.*.

Created on 19 Apr 2018  ·  11Comments  ·  Source: rap2hpoutre/laravel-log-viewer

Encrypter.php -> getJsonPayload waits payload to be json_decodeable bash64 encrypted data.
But the payload comes as base64 encoded string of log file name (lumen-2018-04-19.log).
So selecting log file throws an invalid payload exception.

bug

Most helpful comment

@rwattogl Could you try to reload the views cache? Just run:

php artisan view:clear

All 11 comments

What version of laravel log viewer do you use?

I tried 0.14.3 to 0.11.2 one by one. 0.11.2 worked others did not worked. I was using 0.10.* and when I see the secury issue I tried to update package but it did not worked out.

Thank you! Maybe there is something about view cache (not sure though). Could you remove everything in storage/framework/views/ then try again?

Confirm I am getting the same issue with Laravel 5.6
"laravel/framework": "5.6.*",
"rap2hpoutre/laravel-log-viewer": "~0.14",

I also tested with ~0.11. It was definitely working previously, but some update since (possibly to Laravel?) has broken it.

(1/1) DecryptExceptionThe payload is invalid.
--
in Encrypter.php (line 191)
at Encrypter->getJsonPayload(null)in Encrypter.php (line 134)
at Encrypter->decrypt('bGFyYXZlbC0yMDE4LTA0LTI0LmxvZw==')in Facade.php (line 221)
at Facade::__callStatic('decrypt', array('bGFyYXZlbC0yMDE4LTA0LTI0LmxvZw=='))in LogViewerController.php (line 24)
at LogViewerController->index()

@rwattogl Could you try to reload the views cache? Just run:

php artisan view:clear

Sorry, forgot to mention I had already done that (and have tried manually clearing the directories too). We update new versions of the site automatically via ansible and clear all the caches on updating, so any of those are unlikely to be the issue. If you're not able to reproduce the issue yourself, I should have some time to investigate later this week and will report back.

@rwattogl Ok. I still think there is a problem in the view. You have base64 strings coming from the view, and this does not exists anymore in the view, that's why I asked to clear the cache... But, according to your answer, you already cleaned he cache. So maybe the is a view somewhere else: did you changed the default view? Or did you published the view?

Could you check in your resources/views/vendor folder if you find something about the log viewer? If so, remove it.

There is no base64 encoding in the current view: https://github.com/rap2hpoutre/laravel-log-viewer/blob/master/src/views/log.blade.php

(thank you for your patience)

Ah, you're completely correct - I forgot we had a customised view in there, which hasn't been updated in line with the latest version of the code. I replaced the base64 functions with the new style references to \Illuminate\Support\Facades\Crypt::encrypt and it all works perfectly again. It could be worth @Cyclops0571 checking in there as well, especially if they've been jumping around versions and had also published that view.

@Cyclops0571 Did it solved your problem?

@rap2hpoutre +1 for php artisan view:clear

It seems it's OK now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

avesgit picture avesgit  ·  7Comments

rap2hpoutre picture rap2hpoutre  ·  7Comments

akoepcke picture akoepcke  ·  9Comments

judgej picture judgej  ·  9Comments

raymondTheDev picture raymondTheDev  ·  12Comments