Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theming error when converting SVG to PNG for email #11206

Closed
JUVOJustin opened this issue Sep 13, 2018 · 14 comments
Closed

Theming error when converting SVG to PNG for email #11206

JUVOJustin opened this issue Sep 13, 2018 · 14 comments

Comments

@JUVOJustin
Copy link

I currently can´t send Emails via smtp because the Theming Add-On is causing a TypeError. After deactivating the Add-On everything is working as supposed.

Steps to reproduce

  1. Activate Theming Add-On
  2. Set SMTP Details via Interface or config
  3. "Send Mail"

Expected behaviour

Test E-Mail Delivery with SMTP

Actual behaviour

PHP Error caused by the theming Add-On

Server configuration

Operating system:
Ubuntu 18.04

Web server:
Apache 2.4

Database:
MariaDB

PHP version:
7.2

Nextcloud version: (see Nextcloud admin page)
14.0.0

Updated from an older Nextcloud/ownCloud or fresh install:
Fresh Install

Where did you install Nextcloud from:
Manually , Nextcloud Website

No errors

List of activated apps:

App list
 - activity: 2.7.0
  - cloud_federation_api: 0.0.1
  - dav: 1.6.0
  - federatedfilesharing: 1.4.0
  - files: 1.9.0
  - files_external: 1.5.0
  - files_pdfviewer: 1.3.2
  - files_sharing: 1.6.2
  - files_texteditor: 2.6.0
  - files_trashbin: 1.4.1
  - files_versions: 1.7.1
  - files_videoplayer: 1.3.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.2.0
  - nextcloud_announcements: 1.3.0
  - notifications: 2.2.1
  - oauth2: 1.2.1
  - password_policy: 1.4.0
  - provisioning_api: 1.4.0
  - ransomware_detection: 0.3.3
  - serverinfo: 1.4.0
  - sharebymail: 1.4.0
  - systemtags: 1.4.0
  - theming: 1.5.0
  - twofactor_backupcodes: 1.3.1
  - twofactor_totp: 1.5.0
  - updatenotification: 1.4.1
  - workflowengine: 1.4.0
Disabled:
  - accessibility
  - admin_audit
  - bruteforcesettings
  - comments
  - encryption
  - federation
  - firstrunwizard
  - gallery
  - support
  - survey_client
  - user_external
  - user_ldap

Nextcloud configuration:

Config report { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.juvo-design.de" ], "mail_smtpdebug": true, "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "14.0.0.19", "overwrite.cli.url": "https:\/\/juvo-design.de", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "memcache.local": "\\OC\\Memcache\\APCu", "overwriteprotocol": "https", "skeletondirectory": "", "logtimezone": "Europe\/Berlin", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "mail_smtpsecure": "tls", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtptimeout": "30", "maintenance": false, "updater.release.channel": "production" }, "apps": { "accessibility": { "enabled": "no", "installed_version": "1.0.1", "types": "" }, "activity": { "enabled": "yes", "installed_version": "2.7.0", "types": "filesystem" }, "backgroundjob": { "lastjob": "3" }, "bruteforcesettings": { "enabled": "no", "installed_version": "1.1.0", "types": "" }, "cloud_federation_api": { "enabled": "yes", "installed_version": "0.0.1", "types": "filesystem" }, "comments": { "enabled": "no", "installed_version": "1.4.0", "types": "logging" }, "core": { "backgroundjobs_mode": "cron", "installedat": "1536799912.2322", "lastcron": "1536858253", "lastupdateResult": "[]", "lastupdatedat": "1536857714", "oc.integritycheck.checker": "[]", "public_files": "files_sharing\/public.php", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "scss.variables": "cce591fc219ff8f7c73d3b6d3a822d22", "shareapi_allow_public_upload": "no", "shareapi_default_expire_date": "yes", "shareapi_enable_link_password_by_default": "yes", "shareapi_enforce_expire_date": "yes", "shareapi_enforce_links_password": "yes", "vendor": "nextcloud" }, "dav": { "enabled": "yes", "installed_version": "1.6.0", "types": "filesystem" }, "federatedfilesharing": { "enabled": "yes", "installed_version": "1.4.0", "types": "" }, "federation": { "enabled": "no", "installed_version": "1.4.0", "types": "authentication" }, "files": { "default_quota": "1 GB", "enabled": "yes", "installed_version": "1.9.0", "types": "filesystem" }, "files_external": { "enabled": "yes", "installed_version": "1.5.0", "types": "filesystem" }, "files_pdfviewer": { "enabled": "yes", "installed_version": "1.3.2", "types": "" }, "files_sharing": { "enabled": "yes", "installed_version": "1.6.2", "types": "filesystem" }, "files_texteditor": { "enabled": "yes", "installed_version": "2.6.0", "types": "" }, "files_trashbin": { "enabled": "yes", "installed_version": "1.4.1", "types": "filesystem,dav" }, "files_versions": { "enabled": "yes", "installed_version": "1.7.1", "types": "filesystem,dav" }, "files_videoplayer": { "enabled": "yes", "installed_version": "1.3.0", "types": "" }, "firstrunwizard": { "enabled": "no", "installed_version": "2.3.0", "types": "logging" }, "gallery": { "enabled": "no", "installed_version": "18.1.0", "types": "" }, "logreader": { "enabled": "yes", "installed_version": "2.0.0", "ocsid": "170871", "types": "" }, "lookup_server_connector": { "enabled": "yes", "installed_version": "1.2.0", "types": "authentication" }, "nextcloud_announcements": { "enabled": "yes", "installed_version": "1.3.0", "pub_date": "Sat, 10 Dec 2016 00:00:00 +0100", "types": "logging" }, "notifications": { "enabled": "yes", "installed_version": "2.2.1", "types": "logging" }, "oauth2": { "enabled": "yes", "installed_version": "1.2.1", "types": "authentication" }, "password_policy": { "enabled": "yes", "enforceHaveIBeenPwned": "1", "enforceNumericCharacters": "1", "enforceSpecialCharacters": "1", "enforceUpperLowerCase": "1", "installed_version": "1.4.0", "types": "" }, "provisioning_api": { "enabled": "yes", "installed_version": "1.4.0", "types": "prevent_group_restriction" }, "ransomware_detection": { "debug": 0, "enabled": "yes", "installed_version": "0.3.3", "types": "logging" }, "serverinfo": { "enabled": "yes", "installed_version": "1.4.0", "types": "" }, "sharebymail": { "enabled": "yes", "installed_version": "1.4.0", "types": "filesystem" }, "support": { "enabled": "no", "installed_version": "1.0.0", "types": "" }, "survey_client": { "enabled": "no", "installed_version": "1.2.0", "types": "" }, "systemtags": { "enabled": "yes", "installed_version": "1.4.0", "types": "logging" }, "theming": { "cachebuster": "17", "color": "#303030", "enabled": "yes", "faviconMime": "image\/png", "imprintUrl": "https:\/\/juvo-design.de\/impressum", "installed_version": "1.5.0", "logoMime": "image\/svg+xml", "name": "JUVO Webdesign", "privacyUrl": "https:\/\/juvo-design.de\/datenschutzerklaerung", "types": "logging", "url": "https:\/\/juvo-design.de" }, "twofactor_backupcodes": { "enabled": "yes", "installed_version": "1.3.1", "types": "" }, "twofactor_totp": { "enabled": "yes", "installed_version": "1.5.0", "types": "" }, "updatenotification": { "enabled": "yes", "installed_version": "1.4.1", "types": "" }, "workflowengine": { "enabled": "yes", "installed_version": "1.4.0", "types": "filesystem" } } }

Are you using external storage, if yes which one: local/smb/sftp/...
Yes, three folders are mounted with sftp

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Client configuration

Browser:
Firefox 61

Operating system:
Win 10 Professional

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"PW1ZCXeOMwuKhDpceRxw","level":3,"time":"2018-09-13T18:37:28+02:00","remoteAddr":"37.201.210.253","user":"--","app":"index","method":"POST","url":"\/index.php\/lostpassword\/email","message":{"Exception":"TypeError","Message":"Argument 2 passed to OC\\Log::info() must be of the type array, string given, called in \/var\/www\/html\/nextcloud\/apps\/theming\/lib\/ImageManager.php on line 120","Code":0,"Trace":[{"file":"\/var\/www\/html\/nextcloud\/apps\/theming\/lib\/ImageManager.php","line":120,"function":"info","class":"OC\\Log","type":"->","args":["The image was requested to be no SVG file, but converting it to PNG failed.","no decode delegate for this image format `' @ error\/blob.c\/BlobToImage\/353"]},{"file":"\/var\/www\/html\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php","line":213,"function":"getImage","class":"OCA\\Theming\\ImageManager","type":"->","args":["logo",false]},{"file":"\/var\/www\/html\/nextcloud\/lib\/public\/Defaults.php","line":187,"function":"getLogo","class":"OCA\\Theming\\ThemingDefaults","type":"->","args":[false]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Mail\/EMailTemplate.php","line":384,"function":"getLogo","class":"OCP\\Defaults","type":"->","args":[false]},{"file":"\/var\/www\/html\/nextcloud\/core\/Controller\/LostController.php","line":333,"function":"addHeader","class":"OC\\Mail\\EMailTemplate","type":"->","args":[]},{"file":"\/var\/www\/html\/nextcloud\/core\/Controller\/LostController.php","line":238,"function":"sendEmail","class":"OC\\Core\\Controller\\LostController","type":"->","args":["JUVO"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"email","class":"OC\\Core\\Controller\\LostController","type":"->","args":["JUVO"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\LostController"},"email"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\LostController"},"email"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\LostController","email",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.lost.email"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"core.lost.email"}]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"core.lost.email"}]},{"file":"\/var\/www\/html\/nextcloud\/lib\/base.php","line":989,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/lostpassword\/email"]},{"file":"\/var\/www\/html\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/var\/www\/html\/nextcloud\/lib\/private\/Log.php","Line":179,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko\/20100101 Firefox\/62.0","version":"14.0.0.19"}
{"reqId":"0niaVofjfSXoDfNPPl8v","level":3,"time":"2018-09-13T18:55:55+02:00","remoteAddr":"37.201.210.253","user":"JUVO","app":"index","method":"POST","url":"\/index.php\/settings\/admin\/mailtest","message":{"Exception":"TypeError","Message":"Argument 2 passed to OC\\Log::info() must be of the type array, string given, called in \/var\/www\/html\/nextcloud\/apps\/theming\/lib\/ImageManager.php on line 120","Code":0,"Trace":[{"file":"\/var\/www\/html\/nextcloud\/apps\/theming\/lib\/ImageManager.php","line":120,"function":"info","class":"OC\\Log","type":"->","args":["The image was requested to be no SVG file, but converting it to PNG failed.","no decode delegate for this image format `' @ error\/blob.c\/BlobToImage\/353"]},{"file":"\/var\/www\/html\/nextcloud\/apps\/theming\/lib\/ThemingDefaults.php","line":213,"function":"getImage","class":"OCA\\Theming\\ImageManager","type":"->","args":["logo",false]},{"file":"\/var\/www\/html\/nextcloud\/lib\/public\/Defaults.php","line":187,"function":"getLogo","class":"OCA\\Theming\\ThemingDefaults","type":"->","args":[false]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Mail\/EMailTemplate.php","line":384,"function":"getLogo","class":"OCP\\Defaults","type":"->","args":[false]},{"file":"\/var\/www\/html\/nextcloud\/settings\/Controller\/MailSettingsController.php","line":150,"function":"addHeader","class":"OC\\Mail\\EMailTemplate","type":"->","args":[]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"sendTestMail","class":"OC\\Settings\\Controller\\MailSettingsController","type":"->","args":[]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Settings\\Controller\\MailSettingsController"},"sendTestMail"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Settings\\Controller\\MailSettingsController"},"sendTestMail"]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Settings\\Controller\\MailSettingsController","sendTestMail",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.MailSettings.sendTestMail"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"settings.MailSettings.sendTestMail"}]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"settings.MailSettings.sendTestMail"}]},{"file":"\/var\/www\/html\/nextcloud\/lib\/base.php","line":989,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/settings\/admin\/mailtest"]},{"file":"\/var\/www\/html\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/var\/www\/html\/nextcloud\/lib\/private\/Log.php","Line":179,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko\/20100101 Firefox\/62.0","version":"14.0.0.19"}
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #6784 (Php error?), #8740 (PHP errors (libpng)), #285 (PHP error in logfile), #1494 (legacy/image.php No error handling), and #8293 (PHP fatal error after running web updater).

@arnydo
Copy link

arnydo commented Sep 27, 2018

+1

Same issue. Just verified SMTP works after disabling Theming app..

@arnydo
Copy link

arnydo commented Sep 28, 2018

Both of our logs indicate issues converting the SVG file to PNG. Did you upload a SVG file to the theme by chance?

I replaced the SVG with a PNG and the error has stopped.

All is good now.

@kesselb
Copy link
Contributor

kesselb commented Sep 29, 2018

Could you share the broken logo for easier debugging?

@JUVOJustin
Copy link
Author

I can agree, that the error occured when using any svg file. it was not specific to a specific one.

Meanwhile i was able to solve the problem with completely removing and reinstalling the theming plugin.

@MorrisJobke
Copy link
Member

cc @juliushaertl for the SVG to PNG conversion

@MorrisJobke MorrisJobke changed the title Theming Add-On causing PHP Error Theming error when converting SVG to PNG for email Oct 2, 2018
@MorrisJobke
Copy link
Member

MorrisJobke commented Oct 2, 2018

What PHP extensions do you have enabled?

@kesselb
Copy link
Contributor

kesselb commented Oct 8, 2018

I fixed the type error (#11610). Could you try again when Nextcloud 14.0.2 is released? Even when conversion from svg to png does not work the mail should be send.

@juliushaertl
Copy link
Member

@JUVOWebDes @arnydo Can you check the output of the following command: identify -list format | grep SVG

It should output a list of supported SVG formats by the imagick library of your system:

     MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
      SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.44.3)
     SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.44.3)

@JUVOJustin
Copy link
Author

@juliushaertl in my case the output was:

sudo apt install imagemagick-6.q16
sudo apt install graphicsmagick-imagemagick-compat
sudo apt install imagemagick-6.q16hdri

I am pretty sure i had a version of imagemagick installed. apt list --installed now shows imagemagick-6.q16 and imagemagick-6-common

@juliushaertl
Copy link
Member

@JUVOWebDes That is rather strange output, i guess that is some debian/ubuntu hint thing since the identify command was not found? If you have imagemagick installed, running identify -list format should give you a list of supported formats as posted above.

@arnydo
Copy link

arnydo commented Oct 8, 2018

@JUVOWebDes That is rather strange output, i guess that is some debian/ubuntu hint thing since the identify command was not found? If you have imagemagick installed, running identify -list format should give you a list of supported formats as posted above.

@juliushaertl I dif not seem to have the identify command either. I updated imagemagic to the latest and was able to run the command. Output is:

MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
SVG  SVG       rw+   Scalable Vector Graphics (XML 2.9.4)
SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (XML 2.9.4)

@juliushaertl
Copy link
Member

I updated imagemagic to the latest and was able to run the command. Output is:

With that update, do you still get the error or is it properly generating the png files?

@MorrisJobke
Copy link
Member

As there is no feedback since a while and we can't reproduce the issue I will close this ticket. If this is still happening please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants