-
Notifications
You must be signed in to change notification settings - Fork 30
Fix warnings in logging + Update php-cs-fixer #1543
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
Conversation
|
I'm running this now for quite some time on kbin.melroy.org. No errors and no warnings anymore like before. Its looking better. @BentiGorlich Let me know what you think and if you may want to change the behavior in case the host key is missing in the parsed url or the id key is missing in the payload. If so, how or what do you like to change? |
| if (!isset($matches[1]) || !isset($matches[2])) { | ||
| $this->logger->warning('Invalid community mention format: {word}', ['word' => $word2]); | ||
| // Just skip and continue | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this is necessary as the regex matching should be enough to know that we always have the needed matches... Maybe you could look into it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also didn't understood that.. However as you see I did notice Warning: Undefined array key 2 on this line.. So there is definitely an issue is very very rare cases.
So hopefully with this logger warning we can find the root-cause. So instead of the warning above (which was not helpful), the new logging should at least log the word2 to the log :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I will keep an eye on it in my log..
Feel free to check as well: tail -f var/log/prod-2025-04-07.log | grep "Invalid community mention format"
Let's hope I can get some result rather sooner than later hehe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BentiGorlich here you have one, it just triggered:
{"message":"Invalid community mention format: https://web.archive.org/web/20250407071403/https://www.woz.ch/2514/uigurinnen/ehe-fuer-die-ethnische-einheit/!N34RPKQ2Y9PB","context":{"word":"https://web.archive.org/web/20250407071403/https://www.woz.ch/2514/uigurinnen/ehe-fuer-die-ethnische-einheit/!N34RPKQ2Y9PB"},"level":300,"level_name":"WARNING","channel":"app","datetime":"2025-04-07T17:28:39.722619+02:00","extra":{}}Co-authored-by: BentiGorlich <[email protected]>
--diffin the console output.{"message":"Warning: Undefined array key \"id\"","context":{"exception":{"class":"ErrorException","message":"Warning: Undefined array key \"id\"","code":0,"file":"/var/www/kbin.melroy.org/html/src/Service/ActivityPub/SignatureValidator.php:55"}},"level":400,"level_name":"ERROR","channel":"php","datetime":"2025-04-03T07:08:06.583562+00:00","extra":{}} {"message":"Warning: Undefined array key 2","context":{"exception":{"class":"ErrorException","message":"Warning: Undefined array key 2","code":0,"file":"/var/www/kbin.melroy.org/html/src/Markdown/Listener/CacheMarkdownListener.php:157"}},"level":400,"level_name":"ERROR","channel":"php","datetime":"2025-04-03T09:58:26.482504+02:00","extra":{}} {"message":"Warning: Undefined array key \"host\"","context":{"exception":{"class":"ErrorException","message":"Warning: Undefined array key \"host\"","code":0,"file":"/var/www/kbin.melroy.org/html/src/Repository/ApActivityRepository.php:84"}},"level":400,"level_name":"ERROR","channel":"php","datetime":"2025-04-03T10:03:36.529903+02:00","extra":{}} {"message":"Warning: Undefined array key \"cc\"","context":{"exception":{"class":"ErrorException","message":"Warning: Undefined array key \"cc\"","code":0,"file":"/var/www/kbin.melroy.org/html/src/Service/ActivityPub/Note.php:70"}},"level":400,"level_name":"ERROR","channel":"php","datetime":"2025-04-03T13:14:50.021176+00:00","extra":{}}