#1 2021-11-17 03:03:09

Salleh
Member
Registered: 2021-11-17

Email not working: RS 3.7.1-6048 CE

I've been scratching my head for the past 2 days trying to troubleshoot why email sending is not working on my manually installed ReportServer 3.7.1-6048 Community Edition.

the following error has been generated even though I have followed the other guides/solution related to email sending:

1) null returned by binding at net.datenwerke.rs.core.service.mail.MailModule.provideDefaultFrom()
but the 3rd parameter of net.datenwerke.rs.core.service.mail.SimpleCryptoMail.<init>(SimpleCryptoMail.java:70) is not @Nullable
  at net.datenwerke.rs.core.service.mail.MailModule.provideDefaultFrom(MailModule.java:186)
  at net.datenwerke.rs.core.service.mail.MailModule.provideDefaultFrom(MailModule.java:186)
  while locating java.lang.String annotated with @net.datenwerke.rs.core.service.mail.annotations.MailModuleDefaultFrom()
    for the 3rd parameter of net.datenwerke.rs.core.service.mail.SimpleCryptoMail.<init>(SimpleCryptoMail.java:70)
  while locating net.datenwerke.rs.core.service.mail.SimpleCryptoMail annotated with @com.google.inject.internal.UniqueAnnotatio
ns$Internal(value=1)
...
...
...

I have done the following configurations:

1) in /FileServer/etc/mail/mail.cf:

<?xml version="1.0" encoding="UTF-8"?>
<!--
ReportServer Configuration File
filename: mail/mail.cf
-------------
Deprecated: Use email SMTP datasinks instead with default email datasink.
-------------
Configures email server settings.
-->
<configuration>
   <smtp>
      <host>mymailserverfqdn</host>
      <port>465</port>
      <ssl>true</ssl>
      <tls>
         <enable>false</enable>
         <require>false</require>
      </tls>
      <username>XXX</username>
      <password>XXX</password>
   </smtp>
   <mail>
      <sender>XXX</sender>
      <senderName>XXX</senderName>
      <forceSender>false</forceSender>
      <encryptionPolicy>allow_mixed</encryptionPolicy>
   </mail>
</configuration>

the password only has alphanumeric and underscore

2) in /FileServer/etc/datasinks/datasinks.cf:

<?xml version="1.0" encoding="UTF-8"?>
<!--
ReportServer Configuration File
filename: datasinks/datasinks.cf

Configures datasinks including default datasinks for each datasink type.
You can select the default datasink by name:
<defaultDatasinkName>Default Datasink</defaultDatasinkName>
or by id:
<defaultDatasinkId>14</defaultDatasinkId>
-->
<configuration>
  <email disabled="false" supportsScheduling="true">
    <defaultDatasinkName>Default Email Datasink</defaultDatasinkName>
  </email>
...
...
</configuration>

3) and I have a datasinks of type Email with name 'Default Email Datasink' and the following exported config:

<?xml version="1.0" encoding="UTF-8"?>
<reportServerExport xmlns="http://reportserver.datenwerke.net/eximport">
   <head>
      <name>Datasink-Export</name>
      <description/>
      <date>2021-11-17-10-55-31 +0800</date>
      <reportServerVersion/>
   </head>
   <data>
      <exporterData exporterType="net.datenwerke.rs.base.ext.service.datasinkmanager.eximport.DatasinkManagerExporter">
         <exportedItem type="net.datenwerke.rs.emaildatasink.service.emaildatasink.definitions.EmailDatasink"
                       xml:id="net.datenwerke.rs.emaildatasink.service.emaildatasink.definitions.EmailDatasink-8614">
            <itemProperty type="java.lang.Integer" name="port" value="465"/>
            <itemProperty type="java.lang.String" name="sender">xxxxxx</itemProperty>
            <itemProperty type="java.sql.Timestamp"
                          name="lastUpdated"
                          value="2021-11-17-10-04-36 +0800"/>
            <itemProperty type="java.lang.String" name="password">xxxaverylongstringxxx</itemProperty>
            <itemProperty type="java.lang.String" name="senderName">Report Admin</itemProperty>
            <itemProperty type="java.lang.String" name="username">xxxxxx</itemProperty>
            <itemProperty type="java.lang.Boolean" name="forceSender" value="false"/>
            <itemProperty type="java.lang.Boolean" name="tlsRequire" value="false"/>
            <itemProperty type="java.lang.Boolean" name="tlsEnable" value="false"/>
            <itemProperty type="java.lang.String" name="host">mymailserverfqdn</itemProperty>
            <itemProperty type="java.lang.Integer" name="position" value="0"/>
            <itemProperty type="java.lang.String" name="encryptionPolicy">allow_mixed</itemProperty>
            <itemProperty type="java.lang.String" name="name">Default Email Datasink</itemProperty>
            <itemProperty type="java.sql.Timestamp"
                          name="createdOn"
                          value="2021-11-16-16-54-23 +0800"/>
            <itemProperty type="java.lang.Boolean" name="sslEnable" value="true"/>
            <itemProperty type="java.lang.Long" name="flags" value="0"/>
            <itemProperty type="java.util.List"
                          name="children"
                          isCollection="true"
                          propertyType="net.datenwerke.treedb.service.treedb.AbstractNode"/>
         </exportedItem>
      </exporterData>
      ...
      ...
      ...
   </data>
</reportServerExport>


I've restarted the tomcat server every time changing the configuration as well as clicking on the apply button... but unfortunately nothing works and it is very frustrating...

I've check the source code of SimpleCryptoMail.java for that 3rd parameters and it was pointing to the 'from' parameter... based on the config... the from parameter should already been defined based on the 'Sender' key from the config xml... So.. at the moment I really don't have any clue how to proceed further to resolve the issue.

The following is my server setup:
OS: Ubuntu 20.04
Java: openjdk 11.0.11 (default ubuntu repo)
Tomcat: Tomcat 9 (default ubuntu repo)
Reverse Proxy: Nginx (default ubuntu repo) serving HTTPS in front of the tomcat
Database: Mysql 8.0.26 (default ubuntu repo)

Thanks in advance for any pointers to help me resolve this issue.

Last edited by Salleh (2021-11-17 10:30:49)

Offline

#2 2021-11-17 10:00:01

Salleh
Member
Registered: 2021-11-17

Re: Email not working: RS 3.7.1-6048 CE

I have made further test but unfortunately still got the same error.

I've installed simple SMTP server for development (MailSlurper) and don't use any authentication at all... make configuration to the email Datasink and fileserver/etc/mail/mail.cf to reflect the changes (no user id and password required.. no ssl, no tls... plain smtp).

the same error popup when I test the email datasink.

Last edited by Salleh (2021-11-17 10:00:15)

Offline

#3 2021-11-18 01:27:42

Salleh
Member
Registered: 2021-11-17

Re: Email not working: RS 3.7.1-6048 CE

I've managed to make the email work now. I still do not know what is the root cause of the problem but what I did is by just referring to the config posted by Mirza in the following topic: https://forum.reportserver.net/viewtopic.php?id=616

I just copied the config... overwrite my mail.cf and restart the tomcat... then suddenly everything went OK... before that I have followed the same configuration but I do not copy and paste it... I just write directly to the existing default in that file and make the necessary editing.

Maybe something is off with the default config file and by just editing and changing the value won't help... overwriting the whole file with what Mirza's config as in that post and after that changing the value to one's environment seems to resolve the issue.

Offline

#4 2021-11-18 08:36:24

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Email not working: RS 3.7.1-6048 CE

Hi Salleh,

sorry for the late answer.

I checked the differences between your file and the template file, and the only difference is:

<!--
ReportServer Configuration File
filename: mail/mail.cf
-------------
Deprecated: Use email SMTP datasinks instead with default email datasink.
-------------
Configures email server settings.
-->

if I put this in my mail.cf, I get your same error message. Something seems to be wrong with the comment, I think the "-------". We will correct this.

Anyway, if you copy the settings into an email datasink, it should also work, can you pls try this? You can use the "test datasink" button for testing.

Regards,
Eduardo

Offline

#5 2021-11-18 08:53:30

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Email not working: RS 3.7.1-6048 CE

Hi Salleh,

we changed the default mail.cf comment to:

<!--
ReportServer Configuration File
filename: mail/mail.cf
==========
Deprecated: Use email SMTP datasinks instead with default email datasink.
==========
Configures email server settings.
-->

and now it works. We will fix this in the next ReportServer's version.

Regards,
Eduardo

Offline

#6 2022-01-25 16:46:40

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Email not working: RS 3.7.1-6048 CE

Hi Salleh,

pls note we released 4.0.0 today where this is available: https://forum.reportserver.net/viewtopic.php?id=2940

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB