Captiveportal Template Upload Fails

Started by tong2x, December 29, 2020, 06:28:58 AM

Previous topic - Next topic
OPNsense 20.7.7_1-amd64
FreeBSD 12.1-RELEASE-p11-HBSD
OpenSSL 1.1.1i 8 Dec 2020

old templates and modified templates are being rejected without any error even in logs, just closes the template upload window.

downloading the default template and uploading is ok (no changes). adding even a single image file in /image somehow destroys the template.

I have 4 system, all are the same cant upload modified templates. all have been update to 20.7.7_1

anywya to manually upload the files? without using the upload GUI? and would it work?

anyone with captiveportal and using 20.7.7_1?

i have tried to reset to default but same thing happen.. i cant upload a modified template... it should closes the window and the template does not appear

Hello,

i can't upload templates since 20.7.7_x, too.
The error log seems to be fine: no error log point to a failed upload.

How we can fix this quickly (as tong2x asked, how to upload without GUI)?

to add

some failed templates show this on logs. I say "some" becuase most failed upload does not show anything on logs.


Quote2020-12-29T15:25:37   configd.py[21139]   [a922a169-75f8-4825-b177-b9f86287c90c] Script action failed with Command '/usr/local/opnsense/scripts/OPNsense/CaptivePortal/strip_template.py 'cp_2cfdbd8d-c875-430b-af03-3897a1af90ff.tmp'' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 479, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/opnsense/scripts/OPNsense/CaptivePortal/strip_template.py 'cp_2cfdbd8d-c875-430b-af03-3897a1af90ff.tmp'' returned non-zero exit status 1.

if you upload the default unmodified template, you get the following...
Quote2020-12-29T15:34:49   configd.py[21139]   [9a61b866-280c-4471-a8c1-58002e77b404] strip user captiveportal web template package and return new base64 encoded content

it would be nice if it would be possible to upload manually until this issue is resolved, i have tried to restore to default in console one of my system. but it was a no go, i have also tried the development firmware same thing...
i guess one last thing im thingking is to reinstall to 20.7.5 or 20.7.6 is there even a easyway to go back to older builds?

December 29, 2020, 05:40:00 PM #4 Last Edit: December 29, 2020, 05:42:43 PM by daviesb
Hi,

Getting same symptoms.

Fresh install does not like modified template, but on an old VM version (sorry can't remember what ver - but it did take a few steps to get to 20.7.7), was able to upgrade to 20.7.7 and it happily works with modified Template (to be clear - Template was uploaded under "old" version).

A bit of playing around - only way I can get it to work is to ensure that the Image file is very small.
Not sure if it is a file size or dimension (height/width) limitation at the moment.

May be a red herring but possibly linked to the class="brand-logo" statement?
Sorry - not a Web designer/CSS guru and so struggled to dig any further.


anyone knows how to revert php?
I have tried to revert the build but it seem it was not the issue obviously.

Quoteopnsense-revert -r 20.7.4 opnsense

based on changelog there as an update to
ports: php 7.3.25[13] build 20.7.6
mvc: new Base64Field type build 20.7.5
ports: php 7.3.23[6] build 20.7.4

I opened an issue
https://github.com/opnsense/core/issues/4558

@fichtner replied "probably"
https://github.com/opnsense/core/issues/4533

which seems to be around the issue with the deflating of archive lighthttpd

anyone knows how to update lighttpd to lighttpd-1.4.58 (OpenSSL)
or revert to older version other than lighttpd-1.4.56?

It's literally in the thread I posted.

https://github.com/opnsense/core/issues/4533#issuecomment-748068838

# opnsense-revert -r 20.7.6 lighttpd && configctl webgui restart


Cheers,
Franco

December 30, 2020, 04:11:07 PM #9 Last Edit: December 31, 2020, 02:17:54 AM by tong2x
hello franco,

sorry missed your original reply in the github thread.
was trying the other command in the thread (ithink it was for the newer version of lighttpd) which resulted to errors.


i can confirm revert command works, to those having issues also, run the command in console. that should allow template upload again.


thank you