Skip to content

Conversation

@melroy89
Copy link
Member

@melroy89 melroy89 commented Apr 5, 2025

  • Update php-cs-fixer & and show also the --diff in the console output.
  • Trying to address the warnings I constantly see in the Mbin logs.
{"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":{}}

@melroy89 melroy89 added enhancement New feature or request backend Backend related issues and pull requests labels Apr 5, 2025
@melroy89 melroy89 added this to the v1.8.2 milestone Apr 5, 2025
@melroy89 melroy89 requested a review from BentiGorlich April 5, 2025 13:55
@melroy89 melroy89 added the activitypub ActivityPub related issues label Apr 5, 2025
@melroy89
Copy link
Member Author

melroy89 commented Apr 7, 2025

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?

Comment on lines +158 to +162
if (!isset($matches[1]) || !isset($matches[2])) {
$this->logger->warning('Invalid community mention format: {word}', ['word' => $word2]);
// Just skip and continue
continue;
}
Copy link
Member

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?

Copy link
Member Author

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 :).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true :)

Copy link
Member Author

@melroy89 melroy89 Apr 7, 2025

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.

Copy link
Member Author

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":{}}

@melroy89 melroy89 enabled auto-merge (squash) April 7, 2025 11:48
@melroy89 melroy89 merged commit 8163c2f into main Apr 7, 2025
7 checks passed
@melroy89 melroy89 deleted the fix_warnings branch April 7, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub ActivityPub related issues backend Backend related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants