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

已关闭
aab5 年之前创建 · 15 条评论
aab 评论于 5 年之前

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 评论于 5 年之前
所有者

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

Just pushed a commit to experimental branch, can you try it?
aab 评论于 5 年之前
发布者

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 评论于 5 年之前
发布者

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 评论于 5 年之前
所有者

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

that error sounds different/unrelated, is it as frequent?
aab 评论于 5 年之前
发布者

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 评论于 5 年之前
所有者

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 评论于 5 年之前
所有者

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 评论于 5 年之前
发布者

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 评论于 5 年之前
所有者
这个人很懒,什么都没留下。
aab 评论于 5 年之前
发布者

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 评论于 5 年之前
所有者

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 评论于 5 年之前
发布者

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 评论于 5 年之前
所有者

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 评论于 4 年之前
所有者

updates on this?

updates on this?
aab 评论于 4 年之前
发布者

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! :)
diogo4 年之前 关闭
登录 并参与到对话中。
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。