Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-08-27 21:06:24

gilesdring
New Member
From: Calderfornia, West Yorkshire
Registered: 2024-08-27
Posts: 5
GitHub Mastodon

Update to 4.8.8 results in Bad Gateway

I’m running a Textpattern site for a local cinema, and we’re stuck on 4.7.3 (and have been for a while!). I’ve tried to update to 4.8.x numerous times. The admin site seems to work OK – I can login and see diagnostics, and all seems OK… but when I try to access the site I am presented with a Bad Gateway message – and a core dump. Any suggestions for places to look?

My diagnostic output before is as follows:

Textpattern version: 4.7.3 (7c46d1f4c8ac79e62a7d5e54a9ddac53)
Last update: 2019-09-20 20:16:26/2019-09-20 20:08:28
Textpattern path: __TXP-ROOT/textpattern
Article URL pattern: section_title
Production status: live
Temporary directory path: __TXP-ROOT/textpattern/tmp
PHP version: 7.3.33
GD Graphics Library: Unavailable
Server timezone: UTC
Server local time: 2024-08-27 21:00:22
Daylight Saving Time enabled?: 1
Automatically adjust Daylight Saving Time setting?: 1
Time zone (GMT offset in seconds): Europe/London (0)
MySQL: 5.7.39 (MySQL Community Server (GPL)) 
Database server time: 2024-08-27 21:00:22
Database server time offset: 0 s
Database server timezone: SYSTEM
Database session timezone: SYSTEM
Locale: en_GB.UTF-8
Site / Admin language: en-gb / en-gb
Web server: Apache/2.4.38 (Debian)
Apache version: Apache/2.4.38 (Debian)
PHP server API: apache2handler
RFC 2616 headers: 
Server OS: Linux 6.5.0-45-generic
Admin-side theme: hiveneutral 4.7.3
Active plugins: 
	arc_meta-2.0.1-beta.1
	dtx_cinema_calendar-0.16.0
	glz_custom_fields-2.0.1
	rss_admin_db_manager-4.6.0
	smd_textile_bar-0.1.1
	smd_where_used-0.30
	soo_page_numbers-0.4.2
	upm_insert_tab-0.3

Pre-flight check: 
------------------------

New Textpattern version 4.8.8 available for download.

New Textpattern pre-release version 4.9.0-beta.1 available for download. Please visit the Textpattern website for more information.
------------------------

.htaccess file contents: 
------------------------
# BEGIN Textpattern
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default

<IfModule mod_rewrite.c>
    RewriteEngine On

    #Options +FollowSymlinks

    #RewriteBase /relative/web/path/

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]

    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(.*) index.php

    RewriteCond %{HTTP:Authorization}  !^$
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

    # Force HTTPS
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

<IfModule mod_mime.c>
    AddType image/svg+xml  svg svgz
    AddEncoding gzip       svgz
</IfModule>
# END Textpattern

------------------------

After the update it looks like this:

Textpattern version: 4.8.8 (a5969b336c096d872a7ecab9ee25914b)
Last update: 2024-08-27 21:05:03/2022-01-24 13:32:38
Textpattern path: __TXP-ROOT/textpattern
Article URL pattern: section_title
Production status: live
Temporary directory path: __TXP-ROOT/textpattern/tmp
PHP version: 7.3.33
GD Graphics Library: Unavailable
Intl extension: Unavailable
Multibyte String extension: 7.3.33
Server time zone: Europe/London
Server local time: 2024-08-27 22:05:22
Daylight Saving Time enabled?: 1
Automatically adjust Daylight Saving Time setting?: 1
Time zone (GMT offset in seconds): Europe/London (0)
MySQL: 5.7.39 (MySQL Community Server (GPL)) 
Database server time: 2024-08-27 21:05:22
Database server time offset: 0 s
Database server time zone: SYSTEM
Database session time zone: SYSTEM
Locale: en_GB.UTF-8
Site / Admin language: en-gb / en-gb
Web server: Apache/2.4.38 (Debian)
Apache version: Apache/2.4.38 (Debian)
PHP server API: apache2handler
PHP SSL version: OpenSSL 1.1.1d  10 Sep 2019
RFC 2616 headers: 
Server OS: Linux 6.5.0-45-generic
Admin-side theme: hiveneutral 4.8.8
Active plugins: 
	arc_meta-2.0.1-beta.1
	dtx_cinema_calendar-0.16.0
	glz_custom_fields-2.0.1
	rss_admin_db_manager-4.6.0
	smd_textile_bar-0.1.1
	smd_where_used-0.30
	soo_page_numbers-0.4.2
	upm_insert_tab-0.3

Pre-flight check: 
------------------------
New Textpattern pre-release version 4.9.0-beta.1 available for download. Please visit the Textpattern website for more information.
------------------------

.htaccess file contents: 
------------------------
# BEGIN Textpattern
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default

<IfModule mod_rewrite.c>
    RewriteEngine On

    #Options +FollowSymlinks

    #RewriteBase /relative/web/path/

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]

    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(.*) index.php

    RewriteCond %{HTTP:Authorization}  !^$
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

    # Force HTTPS
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

<IfModule mod_mime.c>
    AddType image/svg+xml  svg svgz
    AddEncoding gzip       svgz
</IfModule>
# END Textpattern

------------------------

Any suggestions gratefully received!

For info, I’m running an upgrade lab in a docker compose sandbox, so I can mess around with anything without borking the main site.

Last edited by gilesdring (2024-08-27 21:07:53)

Offline

#2 2024-08-28 05:59:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,702
Website

Re: Update to 4.8.8 results in Bad Gateway

Hi Giles,

I don’t see anything obvious there. I do a few things slightly differently (like force https before the Textpattern rewrites) but you’re experienced and it obviously worked before. Your plugins should all work, at least I use several of them on newer txp versions. The only ones I don’t know are your own one and upm_insert_tab, which is probably admin-side anyway.

I usually then start trying to isolate the problem:

  • Does a standard installation work on the same server setup? Then with your htaccess?
  • Try temporarily disabling plugins. You’ll get “missing tag” errors but if it gets you past the 502, you know where to dig deeper. If you don’t want to trigger any plugin activation/deactivation routines, you can temporarily deactivate them in the database directly by setting the status column to 0 in txp_plugin.
  • Make a very simple new site template in your existing site and assign it to a temporary new section. Do you get output?

Then reintroduce bits until it stops working, and then compare what’s different.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2024-08-28 13:31:22

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,210
GitHub

Re: Update to 4.8.8 results in Bad Gateway

Just a heads-up: MySQL 5.7 & PHP 7.3 are end of life’d. Bump those to MySQL 8.0 & PHP 8.1 when you’ve resolved the core dump, both of those are supported for a while longer.

Offline

#4 2024-08-28 14:59:08

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 187
Website

Re: Update to 4.8.8 results in Bad Gateway

I went through an upgrade from 4.7.3 earlier this year. Jumping to the end didn’t work out well. I ended up upgrading each component by one release step individually, which was painful enough that I scripted the upgrade/downgrade to be automated. A complication was that a lot of previous Txp releases did not used to state the range for PHP versions in the release description.

I doubt my issues will be your issues. For example, my site wouldn’t work on PHP 8.1, but did on 8.0 and 8.2.

Offline

#5 2024-08-28 16:53:04

gilesdring
New Member
From: Calderfornia, West Yorkshire
Registered: 2024-08-27
Posts: 5
GitHub Mastodon

Re: Update to 4.8.8 results in Bad Gateway

gaekwad wrote #337743:

Just a heads-up: MySQL 5.7 & PHP 7.3 are end of life’d. Bump those to MySQL 8.0 & PHP 8.1 when you’ve resolved the core dump, both of those are supported for a while longer.

Yep! That’s the reason for the upgrade!!!

Offline

#6 2024-08-28 16:54:24

gilesdring
New Member
From: Calderfornia, West Yorkshire
Registered: 2024-08-27
Posts: 5
GitHub Mastodon

Re: Update to 4.8.8 results in Bad Gateway

jakob wrote #337738:

Hi Giles,

I don’t see anything obvious there. I do a few things slightly differently (like force https before the Textpattern rewrites) but you’re experienced and it obviously worked before. Your plugins should all work, at least I use several of them on newer txp versions. The only ones I don’t know are your own one and upm_insert_tab, which is probably admin-side anyway.

I usually then start trying to isolate the problem:

  • Does a standard installation work on the same server setup? Then with your htaccess?
  • Try temporarily disabling plugins. You’ll get “missing tag” errors but if it gets you past the 502, you know where to dig deeper. If you don’t want to trigger any plugin activation/deactivation routines, you can temporarily deactivate them in the database directly by setting the status column to 0 in txp_plugin.
  • Make a very simple new site template in your existing site and assign it to a temporary new section. Do you get output?

Then reintroduce bits until it stops working, and then compare what’s different.

Thanks. I’d pretty much come to the same conclusion, but helpful to have it confirmed… I’ll let you know how I get on!

Last edited by gilesdring (2024-08-28 20:05:55)

Offline

#7 2024-08-28 16:57:16

gilesdring
New Member
From: Calderfornia, West Yorkshire
Registered: 2024-08-27
Posts: 5
GitHub Mastodon

Re: Update to 4.8.8 results in Bad Gateway

skewray wrote #337746:

I went through an upgrade from 4.7.3 earlier this year. Jumping to the end didn’t work out well. I ended up upgrading each component by one release step individually, which was painful enough that I scripted the upgrade/downgrade to be automated. A complication was that a lot of previous Txp releases did not used to state the range for PHP versions in the release description.

I doubt my issues will be your issues. For example, my site wouldn’t work on PHP 8.1, but did on 8.0 and 8.2.

This is helpful info! Thanks. Just to clarify, when you say upgraded each component a release step at a time do you mean the main Textpattern release (4.8.0… 4.8.1… etc), or was this a plugin upgrade project!

Offline

#8 2024-08-30 11:42:36

gilesdring
New Member
From: Calderfornia, West Yorkshire
Registered: 2024-08-27
Posts: 5
GitHub Mastodon

Re: Update to 4.8.8 results in Bad Gateway

So a brief update on what I’ve found:

An upgrade 4.7.3 -> 4.8.0 works OK. Upgrading to 4.8.1 breaks things. If I remove content from the template it works, so it’s nothing at the system level.

This enabled me to zero in on the issue, which is around nested output_forms, and a change that happened in 4.8.1 – I think this line…

The line (in taghandlers.php -> output_form)

$yield[] = $thing ? parse($thing) : $thing;

changed to

$yield[] = array($thing);//$thing; ? parse($thing) : $thing;

This caused a problem with my template, which (for better or worse) I’ve set up as follows:

1. default (page) calls…
2. layout_page_with_sidebar (form) which yields the content inside a section, and adds a standard sidebar, which then calls
3. base_page (form) which yields the content of the form and wraps page standard elements.

This has worked up to now, but clearly something about the new yield code causes problems.

My workaround is to capture the yielded content in the layout_page_with_sidebar and then emit that inside the form. This seems to work…

I’m fully fine to hear that what I was doing was unsafe – it just happened to fit the way I’d defined prior sites using templating languages like Jinja / Nunjucks, and it did work… ;-)

Last edited by gilesdring (2024-08-30 11:42:58)

Offline

#9 2024-08-30 14:49:40

etc
Developer
Registered: 2010-11-11
Posts: 5,129
Website GitHub

Re: Update to 4.8.8 results in Bad Gateway

gilesdring wrote #337754:

An upgrade 4.7.3 -> 4.8.0 works OK. Upgrading to 4.8.1 breaks things.

That was possibly a bug, since 4.8.2 has reverted yield storage to the previous format. Once at 4.8.8, you can try it.

Sorry for the hassle.

Offline

Board footer

Powered by FluxBB