Skip to main content
ElkArte 1.1.9 Started by Spuds · · Read 54525 times 0 Members and 2 Guests are viewing this topic. previous topic - next topic

Re: ElkArte 1.1.9

Reply #30

Quote from: Spuds – OK, uninstall your old watermark addon, and then install this beauty!

Not sure if this will fix the issue you are having, but at least this version does run on 1.1.9 where as the previous did not .... so its progress!
Many thanks! That said, the issue remains. The site is running on php7.4 rather than 8.1, if that matters here. 

 

Re: ElkArte 1.1.9

Reply #31

Sent you a PM on my lack of progress:laughing:

As an experiment, please try the attached Attachment.controller.php (just replace the one in your sources/controller directory) and lets see if that does anything good for us.  Past that we really need to hope there is something in your Nginx error logs regarding the 502 that we are generating.
Last Edit: October 21, 2022, 08:45:33 am by Spuds

Re: ElkArte 1.1.9

Reply #32

Quote from: Spuds – Sent you a PM on my lack of progress:laughing:

As an experiment, please try the attached Attachment.controller.php (just replace the one in your sources/controller directory) and lets see if that does anything good for us.  Past that we really need to hope there is something in your Nginx error logs regarding the 502 that we are generating.
Rockin, still a no go. Sure hope this doesn't send you on a wild goose chase then turn out a configuration issue on this end. :(

Here's an excerpt from the nginx error log after an upload:
Code: [Select]
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254415;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254417;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254419;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254421;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254423;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254425;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254427;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254429;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254431;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254433;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254435;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:25 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;sa=tmpattach;attach=post_tmp_777_6e976dbbe41ba5426878a1e07a75209b;topic=139214 HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?action=post;topic=139214.0;last_msg=1369694"

And access log from the same timeframe:

Code: [Select]
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254415;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254417;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254419;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254421;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254423;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254425;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254427;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254429;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254431;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254433;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254435;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
Last Edit: October 21, 2022, 09:01:05 am by Spuds

Re: ElkArte 1.1.9

Reply #33

Well that is something to go on, and its in the area I tried to adjust in the previous attempt...  Please give this one a try, it simply turns off the content length header as a test, just to see if that is indeed what is causing the error.
Last Edit: October 21, 2022, 08:45:12 am by Spuds

Re: ElkArte 1.1.9

Reply #34

Quote from: Spuds – Well that is something to go on, and its in the area I tried to adjust in the previous attempt...  Please give this one a try, it simply turns off the content length header as a test, just to see if that is indeed what is causing the error.
You're on the right track!  Attachments upload, and the preview shows!! 

Re: ElkArte 1.1.9

Reply #35

:cool: thanks for doing all the testing.   I'll do some more looking at this tomorrow now that I know where/what the problem is!

Re: ElkArte 1.1.9

Reply #36

Well this should be the winner winner,:chicken:chicken dinner ! 

The culprit (I believe) was a misplaced comma (of all things) which caused the sending of a bad content length header.  I don't really have an explanation for why it manifested as a 502 on some sites, and others seemed to ignore the bad header.   Don't know if that was a specific PHP level, or Web Server config, or ??

Attached is the updated Attachments.controller.php file for 1.1.9 only.  Give this a try and lets see what we get:pray:

Also, I noticed that the lazy loading addon was preventing the showing of the admin menu icons, so I've attached an update for that as well.  I'll post that package in the correct thread a bit later on.

Re: ElkArte 1.1.9

Reply #37

Odd what chaos a few misplaced characters can cause. Years ago several random characters on a document made life miserable for me. Turns out the random characters just happened to spell my name, and the document was a marriage certificate. Who knew!?

Seriously, I'll give it the test sometime this evening!

Edit: the latest version appears to be operating properly!
Last Edit: October 21, 2022, 10:04:34 pm by badmonkey

Re: ElkArte 1.1.9

Reply #38

Quote from: badmonkey – Odd what chaos a few misplaced characters can cause. Years ago several random characters on a document made life miserable for me. Turns out the random characters just happened to spell my name, and the document was a marriage certificate. Who knew!?
Gotta say, this made me laugh all day:rofl:

Glad the fix worked, now I can repack 1.1.9

Re: ElkArte 1.1.9

Reply #39

Another potential bugz are spotted. Quoted messages containing apostrophes and quote marks yields decimal code or html code, respectively. There could be others, these are the ones noted so far. 

Re: ElkArte 1.1.9

Reply #40

Thanks, I'll take a look at that.  Keep those reports coming !

Re: ElkArte 1.1.9

Reply #41

I was pretty sure I knew what was causing this, and now having looked at it, confirmed.

Long story, but we made a change in the quick quote function to account for unescaped special characters like & that made it into the DB due to an error in the post by email function.   The fix for that was to allow unescaped characters in the XML response, but that also means escaped characters are not unescaped by magic.

So lets try to fix the issue another way .... in post.controller.php find
Code: (find) [Select]
			$context['quote']['xml'] = strtr($context['quote']['xml'], array('&nbsp;' => ' ', '<' => '&lt;', '>' => '&gt;'));
Code: (replace) [Select]
			$context['quote']['xml'] = strtr(Util::htmlspecialchars($context['quote']['xml']), array('&nbsp;' => '&#160;'));

Then in Xml.template.php lets revert the proposed change
Code: (find) [Select]
	<quote><![CDA' . 'TA[', cleanXml($context['quote']['xml']), ']' . ']></quote>
Code: (replace) [Select]
	<quote>', cleanXml($context['quote']['xml']), '</quote>

That should fix the original issue but not cause this new issue.

Re: ElkArte 1.1.9

Reply #42

@Spuds  - at first I thought that was reverting the fix we made in 1.1.6, for a similar problem in Xml.template.php function template_quotefast()

https://www.elkarte.net/community/index.php?topic=6157.0

..but after a closer look, no...  but it does raise the question of whether it should?
 

// Deep inside every dilemma lies a solution that involves explosives //

Re: ElkArte 1.1.9

Reply #43

That actually is the same one.  The bug that you reported has been around for "a bit", so we have to deal with the fact that some posts will have this issue.

The original fix was the CDATA idea which allows us to send unescaped character data, but then we should un-escape anything escaped.  Note that the line in question may look like what you posted <quote><![CDATA[ or if done by the patch system, it will be <quote><![CDA' . 'TA[ the later due to the fact the patch system is XML so you can't have a CDATA string in it as it would not be a valid file, so it gets broken and concatenated.

So you should try to undo the edit you made and then add the new edit to the post.controller, which escapes the problematic characters if they are not already escaped (e.g. it will not cause &amp; => &amp;amp;)

Re: ElkArte 1.1.9

Reply #44

Quote from: Spuds – That actually is the same one.  The bug that you reported has been around for "a bit", so we have to deal with the fact that some posts will have this issue.

The original fix was the CDATA idea which allows us to send unescaped character data, but then we should un-escape anything escaped.  Note that the line in question may look like what you posted <quote><![CDATA[ or if done by the patch system, it will be <quote><![CDA' . 'TA[ the later due to the fact the patch system is XML so you can't have a CDATA string in it as it would not be a valid file, so it gets broken and concatenated.

So you should try to undo the edit you made and then add the new edit to the post.controller, which escapes the problematic characters if they are not already escaped (e.g. it will not cause &amp; => &amp;amp;)

Alrighty then, I'll make the change and then update the 1.1.6 fix topic after testing (oddly, none of my users pointed it out if they had encountered the problem - and I haven't noticed it - but they're a lazy bunch and somewhat adverse to using symbols and punctuation other than periods, commas and the occasional  exclamation point - if they even use those - anyway..) 

// Deep inside every dilemma lies a solution that involves explosives //