#120 PHP Notice: Array to string conversion in /var/www/gnusocial/lib/util/xmloutputter.php on line 141

Closed
opened 3 months ago by aab · 15 comments
aab commented 3 months ago

I got this several times per day in the logs:

[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"

Could this be related to the message in the UI "File not found in the system"? Any hint to fix it?

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?
Diogo Cordeiro commented 3 months ago
Owner

Just pushed a commit to experimental branch, can you try it?

Just pushed a commit to experimental branch, can you try it?
aab commented 3 months ago
Poster

I just made the changes to xmloutputter.php; i'll report in some hours, to be sure it is fixed. Thanks!

I just made the changes to xmloutputter.php; i'll report in some hours, to be sure it is fixed. Thanks!
aab commented 3 months ago
Poster

I just got this:

[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"

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>
Diogo Cordeiro commented 3 months ago
Owner

that error sounds different/unrelated, is it as frequent?

that error sounds different/unrelated, is it as frequent?
aab commented 3 months ago
Poster

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.

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.
Diogo Cordeiro commented 3 months ago
Owner

so, fixing one error just triggered another one that is as frequent... nice..., did anything change in the UI after applying this commit?

so, fixing one error just triggered another one that is as frequent... nice..., did anything change in the UI after applying this commit?
Diogo Cordeiro commented 3 months ago
Owner

Okay, replaced that commit with one with a couple more changes, let's see if this helps :)

Okay, replaced that commit with one with a couple more changes, let's see if this helps :)
aab commented 3 months ago
Poster

No changes in UI as far as i know... I'm applying the changes now and will check in the morning. Good night :)

No changes in UI as far as i know... I'm applying the changes now and will check in the morning. Good night :)
Diogo Cordeiro commented 3 months ago
Owner
There is no content yet.
aab commented 3 months ago
Poster

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

#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"

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>
Diogo Cordeiro commented 3 months ago
Owner

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

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 :)
aab commented 2 months ago
Poster

Ok, i just upgraded to experimental (i think...). Grepping "xmloutputter", a similar message appears on logs:

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"

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:

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

This is in nginx error log; can't find anything on gs logs.

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.
Diogo Cordeiro commented 2 months ago
Owner

fixed the xmlstringer issue. do as suggested in irc and find what plugin is bugging xml headers :)

fixed the xmlstringer issue. do as suggested in irc and find what plugin is bugging xml headers :)
Diogo Cordeiro commented 2 months ago
Owner

updates on this?

updates on this?
aab commented 2 months ago
Poster

Sorry, I wanted to wait a bit just in case the error re-appeared. Yes, it is fixed! :)

Sorry, I wanted to wait a bit just in case the error re-appeared. Yes, it is fixed! :)
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.