Closed tehsYs closed 7 years ago
It might be imagemagick. Is it installed?
Thank you for the insanely fast answer! Imagemagick wasn't installed, I installed it, restarted mailtrain but the error still persists.
https://github.com/Mailtrain-org/mailtrain/blob/master/routes/editorapi.js#L98 Perhaps the token is already gone when the request hits the api. Could you test with a higher value, let's say 10 seconds?
Tested it, unfortunately did not help the issue.
I'd like to point out the 'ECONNREFUSED 10.0.1.108:80' part of the error log, it tries to connect to a completely wrong port, it should be either 10.1.1.108:3000 (internal mailtrian port) or 185.43.205.95:80 (the apache proxy port).
When you're logged in, does this link work for you? http://mailtrain.muranyi.hu/editorapi/img?src=%2Fgrapejs%2Ftemplates%2Fdemo%2Fimages%2Fgrapesjs-logo.png&method=resize¶ms=67%2C67
I get the following error:
Command failed: error : Operation in progress identify: improper image header /tmp/magick-220610A0x_QyzayEJ' @ error/png.c/ReadPNGImage/3930. identify: no data returned
http://mailtrain.muranyi.hu/grapejs/templates/demo/images/grapesjs-logo.png' @ error/url.c/ReadURLImage/263.
Same error:
Command failed: error : Operation in progress identify: improper image header /tmp/magick-22867JaIo6p7QgwPP' @ error/gif.c/ReadGIFImage/1037. identify: no data returned
http://mailtrain.muranyi.hu/mosaico/templates/versafix-1/img/sponsor.gif' @ error/url.c/ReadURLImage/263.
Interestingly when I remove every image from the campaign I can save it, I'm testing it with the included demo grapejs template.
My imagemagick version is 6.8.9.9-5+deb8u8.
Interestingly when I remove every image from the campaign I can save it, I'm testing it with the included demo grapejs template.
Makes sense. When saving, the editorapi generates resized versions of all images.
If the image url is not absolute, the serviceUrl will be added here https://github.com/Mailtrain-org/mailtrain/blob/master/routes/editorapi.js#L267 then imageMagick reads the file from the url here: https://github.com/Mailtrain-org/mailtrain/blob/master/routes/editorapi.js#L211
Perhaps we could narrow it down if you try with an external image url in GrapeJS. Can imageMagick read that?
I tried with https://www.muranyi.hu/wp-content/uploads/sites/5/2016/12/jiol.jpg
Apr 4 18:42:41 mailtrain node[22803]: (node:22803) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): FetchError: request to http://mailtrain.muranyi.hu/editorapi/img?src=https%3A%2F%2Fwww.muranyi.hu%2Fwp-content%2Fuploads%2Fsites%2F5%2F2016%2F12%2Fjiol.jpg&method=resize¶ms=732%2C921 failed, reason: connect ECONNREFUSED 10.0.1.108:80
When I try to open the link in the error message I get: Command failed: identify: not authorized `//www.muranyi.hu/wp-content/uploads/sites/5/2016/12/jiol.jpg' @ error/constitute.c/ReadImage/412.
When I try a http url instead of https I get:
Command failed: error : Operation in progress identify: improper image header /tmp/magick-22919l6RGEvR5B5mB' @ error/png.c/ReadPNGImage/3930. identify: no data returned
http://mailtrain.muranyi.hu/mailtrain-header.png' @ error/url.c/ReadURLImage/263.
Can you contact me via email? git.witzig@icloud.com
Okey we managed to figure this out, nothing wrong with mailtrain (again). Thank you for your help and sorry for wasting your time.
Long story short: I had mailtrain.muranyi.hu in my /etc/hosts file because this was also the name of the virtual machine(OpenVZ adds this automatically) I was running on it. And while 'dig' and 'host' commands ignore this file, curl, wget and apparently nodejs doesn't. Interestingly everything was working fine this way, the problem appeared only when I tried to use GrapeJS.
Hi there,
It seems like a ran into another issue.
I'm running Mailtrain behind an Apache proxy on two separate virtual machines. When I try to create a campaign in GrapeJS everything seems to be working fine but once a I press save on the GrapeJS UI I get the following error in the mailtrain log and my edits won't get saved:
Apr 4 17:30:41 mailtrain node[4292]: (node:4292) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): FetchError: request to http://mailtrain.muranyi.hu/editorapi/img?src=%2Fgrapejs%2Ftemplates%2Fdemo%2Fimages%2Fgrapesjs-logo.png&method=resize¶ms=67%2C67 failed, reason: connect ECONNREFUSED 10.0.1.108:80 Apr 4 17:30:41 mailtrain node[4292]: (node:4292) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): FetchError: request to http://mailtrain.muranyi.hu/editorapi/img?src=%2Fgrapejs%2Ftemplates%2Fdemo%2Fimages%2F550x250.png&method=resize¶ms=520%2C236 failed, reason: connect ECONNREFUSED 10.0.1.108:80 Apr 4 17:30:41 mailtrain node[4292]: (node:4292) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): FetchError: request to http://mailtrain.muranyi.hu/editorapi/img?src=%2Fgrapejs%2Ftemplates%2Fdemo%2Fimages%2F150x150.png&method=resize¶ms=156%2C156 failed, reason: connect ECONNREFUSED 10.0.1.108:80 Apr 4 17:30:41 mailtrain node[4292]: (node:4292) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): FetchError: request to http://mailtrain.muranyi.hu/editorapi/img?src=%2Fgrapejs%2Ftemplates%2Fdemo%2Fimages%2F250x150.png&method=resize¶ms=249%2C149 failed, reason: connect ECONNREFUSED 10.0.1.108:80
It seems like it tries to connect on the wrong port (80), it probably thinks that is the right port because of the apache proxy, while my mailtrain is running on port 3000. 10.0.1.108 is the internal IP of the virtual machine where mailtrain is running.
My Apache proxy settings are the following:
<VirtualHost *:80> ProxyPreserveHost On ProxyPass "/" "http://10.0.1.108:3000/" ProxyPassReverse "/" "http://10.0.1.108:3000/" ServerName mailtrain.muranyi.hu