Solved: Preview image not updated

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Solved: Preview image not updated

Post by Andrey » Tue Jul 06, 2021 2:15 pm

Hi,

Please let me know why the previews did not update after the news was edited.
Also if you copy the news the preview image also copying from the original news and not update after.

We have a last version available from internet update:

Code: Select all

EMM Version	21.04.000.095
Best Regards,
Andrey
Last edited by Andrey on Fri Sep 03, 2021 8:22 am, edited 1 time in total.

maschoff
Site Admin
Posts: 2493
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Preview image not updated

Post by maschoff » Tue Jul 06, 2021 4:11 pm

Could you please explain what exactly you mean by "preview" and by "news"?
OpenEMM Maintainer

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Re: Preview image not updated

Post by Andrey » Wed Jul 07, 2021 4:30 pm

Hi!
maschoff wrote:
Tue Jul 06, 2021 4:11 pm
Could you please explain what exactly you mean by "preview" and by "news"?
Yes, sorry.
If you open the Dashboard and change the list mode of the "Mailing used recently" from List to Preview mode - you should see the small mailings preview pictures. Once they are stoped updated. Only previous mailings picture used.
Image

maschoff
Site Admin
Posts: 2493
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Preview image not updated

Post by maschoff » Wed Jul 07, 2021 4:31 pm

Ok, probably something is wrong with htmltox. Please check in OMT that wkhtmltox exists and that the path is set to the correct destination.
OpenEMM Maintainer

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Re: Preview image not updated

Post by Andrey » Wed Jul 07, 2021 5:34 pm

maschoff wrote:
Wed Jul 07, 2021 4:31 pm
Please check in OMT that wkhtmltox exists and that the path is set to the correct destination
Look's like it's okay.

Code: Select all

=============================================
= OpenEMM Maintenance Tool (OMT) v21.04.086 =
=============================================
Root mode: On
Hostname: OpenEmm
OpenEMM License: OpenEMM (ID: 0)
OpenEMM Runtime Version: 21.04.086
OpenEMM Version: 21.04.000.095
OpenEMM Manual Version: 21.01.005
System-Url: https://cloud.avis-rentacar.ru

Current menu: Show OpenEMM status

OpenEMM status:
Operating System (OS): CentOS 7
Python version: 3.8.3 (default, May 15 2020, 01:26:50)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Sendmail Version: 0.11.1
Postfix Version: 2.10.1
Database client version: /opt/rh/rh-mariadb102/root/usr/bin/mysql  Ver 15.1 Distrib 10.2.33-MariaDB, for Linux (x86_64) using  EditLine wrapper
Database Connection: OK
System-Time: 2021-07-07 19:21:25
System-Time-DB: 2021-07-07 19:21:25
Database version: MariaDB 10.2.33-MariaDB
OpenEMM database structure exists (Version 21.04.000.079)
Database table emm_db_errorlog_tbl: OK
Jobqueue status: OK
DKIM keys available for domains: None
Java version: 1.8.0_292 (Oracle)
Tomcat version: 9.0.45.0
Tomcat-Native version: 1.2.23
Wkhtml version: wkhtmltopdf 0.12.5 (with patched qt)
OpenEMM Application is running (Tomcat ProcessID: 4622, started at: июл06 25:51)
OpenEMM Backend ok: once
OpenEMM Backend running: mailout, update, trigger, generate, mta, pickdist, slrtscn, direct-path, bav-update, bavd, bav, mlcontrol
also

Code: Select all

sudo -u openemm wkhtmltopdf -V
wkhtmltopdf 0.12.5 (with patched qt)

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Re: Preview image not updated

Post by Andrey » Wed Jul 07, 2021 5:49 pm

Hi, Maschoff!
Found this at the log.

Code: Select all

/home/openemm/logs/webapps/emm.log                                                                                                         101458/102K               96%
        at org.agnitas.beans.impl.MailingComponentImpl.loadContentFromURL(MailingComponentImpl.java:200)
        at com.agnitas.beans.impl.MailingImpl.lambda$scanForComponents$9(MailingImpl.java:842)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2021-07-07 17:57:30,231: ERROR [pool-2716-thread-20] com.agnitas.util.preview.impl.PreviewImageServiceImpl - Error generating preview
java.lang.Exception: Preview generation via wkhtmltoimage failed:
/usr/bin/wkhtmltoimage
--quality
50
https://our-correct-domain/mailingsend.do;jsessionid=A4996C566F441B6CFD55C84C5475005E?action=16&mailingID=42&previewForm.format=1&previewForm.customerID=1
/home/openemm/temp/Preview/preview_5415739677412162152.png
        at com.agnitas.util.preview.impl.PreviewImageServiceImpl.renderDocumentWithWkhtml(PreviewImageServiceImpl.java:148)
        at com.agnitas.util.preview.impl.PreviewImageServiceImpl.generatePreview(PreviewImageServiceImpl.java:96)
        at com.agnitas.util.preview.impl.PreviewImageServiceImpl$MailingPreviewTask.run(PreviewImageServiceImpl.java:362)
        at com.agnitas.util.preview.impl.PreviewImageGenerationQueueImpl$WrapperTask.run(PreviewImageGenerationQueueImpl.java:95)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2021-07-07 18:00:30,834: ERROR [pool-3855-thread-6] org.agnitas.beans.impl.MailingComponentImpl - loadContentFromURL:
java.lang.IllegalArgumentException: host parameter is null
        at org.apache.commons.httpclient.HttpConnection.<init>(HttpConnection.java:206)
        at org.apache.commons.httpclient.HttpConnection.<init>(HttpConnection.java:155)
        at org.apache.commons.httpclient.SimpleHttpConnectionManager.getConnectionWithTimeout(SimpleHttpConnectionManager.java:175)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.agnitas.beans.impl.MailingComponentImpl.loadContentFromURL(MailingComponentImpl.java:200)
        at com.agnitas.beans.impl.MailingImpl.lambda$scanForComponents$9(MailingImpl.java:842)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2021-07-07 18:00:31,352: ERROR [pool-2716-thread-21] com.agnitas.util.preview.impl.PreviewImageServiceImpl - Error generating preview
java.lang.Exception: Preview generation via wkhtmltoimage failed:
All the configuration domain looks ok.
Possibly SSL-related.

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Re: Preview image not updated

Post by Andrey » Wed Jul 07, 2021 6:07 pm

Also tried wget the

Code: Select all

 wget http://mydomain/mailingsend.do;jsessionid=A4996C566F441B6CFD55C84C5475005E?action=16&mailingID=42&previewForm.format=1&previewForm.customerID=1
- lead to connection forbidden.
I tried this URL at the browser - the page redirects to the EMM Login page.

aso
Posts: 21
Joined: Fri Jun 19, 2015 12:43 pm

Re: Preview image not updated

Post by aso » Thu Jul 08, 2021 9:00 am

Please make two things to find the reason for the problem of not refreshing thumbnail pictures of your mailings:
1) Check the installationpath of wkhtmltox:
Use os command "> which wkhtmltoimage"
Right now it seems you configured "/usr/bin/wkhtmltoimage" in your OpenEMM. Ist this the correct and working path of wkhtmltoimage?

2) Check wether your OpenEMM server himself can reach the url of the preview html download given in the comment right before this one.
The OpenEMM server himself must be able to download this html content from the preview url to insert it into wkhtml tool for thumbnail generation.
Calling the url with your browser may not work, because its jsession id is outdated or linked to a special IP address which prevents calling it in your browser.

e.g. Url:
http://mydomain/mailingsend.do;jsession ... stomerID=1

If this does not work, please refer to your firewall settings.
The OpenEMM server must be able to call "mydomain" (his own domain, configvalue system.url) and the port of your system (for http: 80, for https: 443)

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Re: Preview image not updated

Post by Andrey » Sat Jul 10, 2021 10:03 am

Hi!
aso wrote: If this does not work, please refer to your firewall settings.
You right! The firewall settings are the case. The mentioned problem started from moving from HTTP to HTTPS service.
In the OpenEmm Installation guide, there is only these lines regarding firewall and HTTP service :

Code: Select all

# firewall-cmd --zone=public --add-port=8080/tcp --permanent
# firewall-cmd --zone=public --add-port=25/tcp --permanent
# firewall-cmd --zone=public --add-forwardport=port=80:proto=tcp:toport=8080 --permanent
There no information regarding the HTTPS settings. So I add one rule after moving TOMCAT to SSL (8443). The firewall settings started to look like this:

Code: Select all

  target: default
  icmp-block-inversion: no
  interfaces: ens160
  sources:
  services: dhcpv6-client ssh
  ports: 8080/tcp 25/tcp 8443/tcp
  protocols:
  masquerade: no
  forward-ports: port=80:proto=tcp:toport=8443:toaddr=
        port=443:proto=tcp:toport=8443:toaddr=
        port=80:proto=tcp:toport=8080:toaddr=
  source-ports:
  icmp-blocks:
  rich rules:
After that, the wktohtml stop processing the URL with the forbidden error (network error).
I can't manage the rules required to firewall the correct way. But after adding the redirect from 443 to 8443 the OpenEmm backend works fine besides wktohtml.
Tried one more thing - I changed the system.url to the system.url = https://mydomain:8443 and this resolve some problem with wktohtml - the PDF pages started to generate and the preview icons also but without the images within.
And there are the new line's in the log:

Code: Select all

2021-07-10 11:15:26,201: ERROR [https-openssl-apr-8443-exec-1] com.agnitas.emm.core.logon.beans.LogonStateBundle - Unexpected logon state: PENDING. Expected: COMPLETE.
(hostId: `null`, admin: `?`)
Please let me know the firewallD settings which are correct for https service.
Best Regads,

Andrey
Posts: 51
Joined: Wed Jun 21, 2017 12:13 pm

Re: Preview image not updated

Post by Andrey » Thu Sep 02, 2021 7:36 pm

SOLVED:
I have Centos 7 which have a bug with the routing internal request to https.
https://bugzilla.redhat.com/show_bug.cgi?id=1445918
So if you switch to https add the following command to the firewall:

Code: Select all

firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --permanent --direct --add-rule ipv4 nat OUTPUT 0 -p tcp -o lo --dport 443 -j REDIRECT --to-ports 8443
firewall-cmd --reload

maschoff
Site Admin
Posts: 2493
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Solved: Preview image not updated

Post by maschoff » Fri Sep 03, 2021 8:52 am

Thanks for your feedback. We describe configuration of iptables (instead of firewalld) in the OpenEMM Install Guide and will stick to it.
OpenEMM Maintainer

Post Reply