120 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. ---
  2. title: PHP Notice: Array to string conversion in /var/www/gnusocial/lib/util/xmloutputter.php on line 141
  3. author: notabug.org/aab
  4. time: Thu, 02 Apr 2020 10:11:19 UTC
  5. status: closed
  6. ---
  7. author: notabug.org
  8. time: Thu, 02 Apr 2020 10:11:19 UTC
  9. content: -----
  10. I got this several times per day in the logs: <code>[error] 31910#31910: *1104369 FastCGI sent in stderr: "PHP message: PHP Notice: Array to string conversion in /var/www/gnusocial/lib/util/xmloutputter.php on line 141" while reading response header from upstream, client: ip_address, server: gnusocial.net, request: "POST /api/statuses/update.xml HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "gnusocial.net"</code> Could this be related to the message in the UI "File not found in the system"? Any hint to fix it?
  11. -----
  12. author: notabug.org
  13. time: Thu, 02 Apr 2020 16:23:02 UTC
  14. content: -----
  15. Just pushed a commit to experimental branch, can you try it?
  16. -----
  17. author: notabug.org
  18. time: Thu, 02 Apr 2020 16:39:28 UTC
  19. content: -----
  20. I just made the changes to xmloutputter.php; i'll report in some hours, to be sure it is fixed. Thanks!
  21. -----
  22. author: notabug.org
  23. time: Thu, 02 Apr 2020 16:46:53 UTC
  24. content: -----
  25. I just got this: <code>[error] 31910#31910: *1189565 FastCGI sent in stderr: "PHP message: PHP Warning: XMLWriter::startDocument(): xmlTextWriterStartDocument : not allowed in this context! in /var/www/gnusocial/lib/util/xmloutputter.php on line 94" while reading response header from upstream, client: ip_address, server: gnusocial.net, request: "POST /api/statuses/update.xml HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "gnusocial.net"</code>
  26. -----
  27. author: notabug.org
  28. time: Thu, 02 Apr 2020 22:16:59 UTC
  29. content: -----
  30. that error sounds different/unrelated, is it as frequent?
  31. -----
  32. author: notabug.org
  33. time: Thu, 02 Apr 2020 22:51:43 UTC
  34. content: -----
  35. Well, grepping "xmloutputter.php" from nginx's error log, i got the second log i've sent every 6-8 minutes, just the same amount as the first. I've reverted the changes, and the first error is back.
  36. -----
  37. author: notabug.org
  38. time: Thu, 02 Apr 2020 23:25:15 UTC
  39. content: -----
  40. so, fixing one error just triggered another one that is as frequent... nice..., did anything change in the UI after applying this commit?
  41. -----
  42. author: notabug.org
  43. time: Thu, 02 Apr 2020 23:52:21 UTC
  44. content: -----
  45. Okay, replaced that commit with one with a couple more changes, let's see if this helps :)
  46. -----
  47. author: notabug.org
  48. time: Fri, 03 Apr 2020 00:05:03 UTC
  49. content: -----
  50. No changes in UI as far as i know... I'm applying the changes now and will check in the morning. Good night :)
  51. -----
  52. author: notabug.org
  53. time: Fri, 03 Apr 2020 00:06:10 UTC
  54. content: -----
  55. -----
  56. author: notabug.org
  57. time: Fri, 03 Apr 2020 07:59:27 UTC
  58. content: -----
  59. Ok, i tried last night but i had to reverse the changes, because the UI was gone, only HTML was shown. If i get it right, i had to change xmloutputter.php and xmlstringer.php, right? The logs showed this (lots of times each): <code> #0 /var/www/gnusocial/lib/util/framework.php(145): require_once() #1 [internal function]: GNUsocial_class_autoload('HTMLOutputter') #2 /var/www/gnusocial/lib/action/action.php(45): spl_autoload_call('HTMLOutputter') [error] 15965#15965: *1265173 FastCGI sent in stderr: "PHP message: Uncaught Exception: Error: Class 'XMLOutputter' not found in /var/www/gnusocial/lib/util/htmloutputter.php:56 #3 /var/www/gnusocial/lib/util/framework.php(186): require_once('/var/www/gnusoc...') #4 /var/www/gnusocial/lib/util/common.php(27): require_once('/var/www/gnusoc...') #5 /var/www/gnusocial/public/index.php(171): require_once('/var/www/gnusoc...') #6 {main}" while reading upstream, client: ip_address, server: gnusocial.net, request: "POST /inbox.json HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "gnusocial.net" </code>
  60. -----
  61. author: notabug.org
  62. time: Fri, 03 Apr 2020 14:29:26 UTC
  63. content: -----
  64. All right, I replaced that commit with something new that, might not solve the issue, but should produce a more helpful error log, I hope; share with me the php errors and gnu social errors while trying please :)
  65. -----
  66. author: notabug.org
  67. time: Sat, 04 Apr 2020 19:21:26 UTC
  68. content: -----
  69. Ok, i just upgraded to experimental (i think...). Grepping "xmloutputter", a similar message appears on logs: <code>2020/04/04 21:05:33 [error] 15965#15965: *1625952 FastCGI sent in stderr: "PHP message: PHP Warning: XMLWriter::startDocument(): xmlTextWriterStartDocument : not allowed in this context! in /var/www/gnusocial/lib/util/xmloutputter.php on line 85" while reading response header from upstream, client: ip_address, server: gnusocial.net, request: "GET /api/statuses/home_timeline.xml?count=20 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "gnusocial.net"</code> It seems to have changed from "on line 94" to "on line 85". (Edit) Comparing "xmloutputter.php" from nightly and experimental, the line has changed positions, but it is the same: "$this->xw->startDocument('1.0', 'UTF-8');" Besides that, a new one: <code>PHP Fatal error: Declaration of Atom10Feed::getString() must be compatible with xmlstringer::getString(): string in /var/www/gnusocial/lib/feeds/atom10feed.php on line 49</code> This is in nginx error log; can't find anything on gs logs.
  70. -----
  71. author: notabug.org
  72. time: Sat, 04 Apr 2020 19:59:57 UTC
  73. content: -----
  74. fixed the xmlstringer issue. do as suggested in irc and find what plugin is bugging xml headers :)
  75. -----
  76. author: notabug.org
  77. time: Tue, 07 Apr 2020 02:35:51 UTC
  78. content: -----
  79. updates on this?
  80. -----
  81. author: notabug.org
  82. time: Tue, 07 Apr 2020 09:49:46 UTC
  83. content: -----
  84. Sorry, I wanted to wait a bit just in case the error re-appeared. Yes, it is fixed! :)
  85. -----