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

E-Mail message forward throws exception #6179

Closed
rasos opened this issue Feb 27, 2017 · 10 comments · Fixed by #7846 or #8645
Closed

E-Mail message forward throws exception #6179

rasos opened this issue Feb 27, 2017 · 10 comments · Fixed by #7846 or #8645

Comments

@rasos
Copy link
Contributor

rasos commented Feb 27, 2017

When selecting a message to be forwarded, the subject line contains an "undefined":
Hier ist ein ausgewählter Teil aus undefined Nachrichten

When pressing the Send button, an internal server error is reported to the user. Seems to be related to localisation (ours is "Deutsch" - German, which has a pretty completed translation set). Here is the log:

Sending messages to e-mails:  [ 'a344r.rer1234@domain.com' ] 
�[34mI20170227-13:39:30.578(1) Exception while invoking method 'mailMessages' TypeError: Cannot read property 'defineLocale' of undefined   at eval (<anonymous>:30:20)   at format.m (<anonymous>:12:4)   at eval (<anonymous>:13:2)   at [object Object].mailMessages (/var/lib/rocket.chat/bundle/programs/server/packages/rocketchat_channel-settings-mail-messages.js:119:29)   at [object Object].methodsMap.(anonymous function) (/var/lib/rocket.chat/bundle/programs/server/packages/rocketchat_lib.js:1064:26)   at maybeAuditArgumentChecks (/var/lib/rocket.chat/bundle/programs/server/packages/ddp-server.js:2108:12)   at /var/lib/rocket.chat/bundle/programs/server/packages/ddp-server.js:1042:22   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)   at /var/lib/rocket.chat/bundle/programs/server/packages/ddp-server.js:1041:43   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)   at /var/lib/rocket.chat/bundle/programs/server/packages/ddp-server.js:1040:48   at Session.method (/var/lib/rocket.chat/bundle/programs/server/packages/ddp-server.js:1018:23)   at /var/lib/rocket.chat/bundle/programs/server/packages/ddp-server.js:880:89   

Rocket.Chat Version: 0.52
Running Instances: 1

@rasos
Copy link
Contributor Author

rasos commented Mar 2, 2017

Please check when refactoring E-Mail in #6196 .
Will check for MAIL_URL #3602 .

@TheReal1604
Copy link
Contributor

TheReal1604 commented Mar 5, 2017

@rasos Got the same issue on my 3 server setup. (but only on locale = german systems) Version: 0.53.0

Exception while invoking method 'mailMessages' TypeError: Cannot read property 'defineLocale' of undefined   at eval (<anonymous>:30:20)   at format.m (<anonymous>:12:4)   at eval (<anonymous>:13:2)   at [object Object].Meteor.methods.mailMessages (packages/rocketchat_channel-settings-mail-messages.js:135:27)   at [object Object].methodsMap.(anonymous function) (/app/bundle/programs/server/packages/rocketchat_lib.js:1093:26)   at maybeAuditArgumentChecks (/app/bundle/programs/server/packages/ddp-server.js:1817:12)   at /app/bundle/programs/server/packages/ddp-server.js:905:20   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)   at /app/bundle/programs/server/packages/ddp-server.js:904:41   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)   at /app/bundle/programs/server/packages/ddp-server.js:903:46   at [object Object]._.extend.protocol_handlers.method (/app/bundle/programs/server/packages/ddp-server.js:876:21)   at /app/bundle/programs/server/packages/ddp-server.js:755:85  

@localguru
Copy link
Contributor

localguru commented May 30, 2017

see this on 0.56.0 too, german locale de_DE.UTF-8

Jun 13 20:22:56 devserv rocketchat[968]: #033[34mMeteor ➔ method#033[39m mailMessages -> userId: suRn6iLpamCiC6mWK , arguments:  { '0':
Jun 13 20:22:56 devserv rocketchat[968]:    { rid: 'DX4TYHhdeMEwPisdk',
Jun 13 20:22:56 devserv rocketchat[968]:      to_users: [],
Jun 13 20:22:56 devserv rocketchat[968]:      to_emails: 'xxxx@domain.de',
Jun 13 20:22:56 devserv rocketchat[968]:      subject: 'Hier ist ein ausgewählter Teil aus foo Nachrichten',
Jun 13 20:22:56 devserv rocketchat[968]:      messages: [ 'awasgFyQGE4pj6B5m', 'JQzmYxNp442SyaQTo' ],
Jun 13 20:22:56 devserv rocketchat[968]:      language: 'de' } }
Jun 13 20:22:56 devserv rocketchat[968]: #033[34mMeteor ➔ method#033[39m canAccessRoom -> userId: suRn6iLpamCiC6mWK , arguments:  { '0': 'DX4TYHhdeMEwPisdk', '1': 'suRn6iLpamCiC6mWK' }
Jun 13 20:22:56 devserv rocketchat[968]: Sending messages to e-mails:  [ 'xxxx@domain.de' ]
Jun 13 20:22:56 devserv rocketchat[968]: #033[34mMeteor ➔ method#033[39m loadLocale -> userId: suRn6iLpamCiC6mWK , arguments:  { '0': 'de' }
Jun 13 20:22:56 devserv rocketchat[968]: Exception while invoking method 'mailMessages' TypeError: Cannot read property 'defineLocale' of undefined
Jun 13 20:22:56 devserv rocketchat[968]:   at eval (<anonymous>:30:20)
Jun 13 20:22:56 devserv rocketchat[968]:   at format.m (<anonymous>:12:4)
Jun 13 20:22:56 devserv rocketchat[968]:   at eval (<anonymous>:13:2)
Jun 13 20:22:56 devserv rocketchat[968]:   at [object Object].Meteor.methods.mailMessages (/opt/rocketchat/Rocket.Chat/programs/server/packages/rocketchat_channel-settings-mail-messages.js:125:23)
Jun 13 20:22:56 devserv rocketchat[968]:   at [object Object].methodsMap.(anonymous function) (/opt/rocketchat/Rocket.Chat/programs/server/packages/rocketchat_lib.js:1021:26)
Jun 13 20:22:56 devserv rocketchat[968]:   at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
Jun 13 20:22:56 devserv rocketchat[968]:   at maybeAuditArgumentChecks (/opt/rocketchat/Rocket.Chat/programs/server/packages/ddp-server.js:1823:12)
Jun 13 20:22:56 devserv rocketchat[968]:   at /opt/rocketchat/Rocket.Chat/programs/server/packages/ddp-server.js:905:20
Jun 13 20:22:56 devserv rocketchat[968]:   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
Jun 13 20:22:56 devserv rocketchat[968]:   at /opt/rocketchat/Rocket.Chat/programs/server/packages/ddp-server.js:904:41
Jun 13 20:22:56 devserv rocketchat[968]:   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
Jun 13 20:22:56 devserv rocketchat[968]:   at /opt/rocketchat/Rocket.Chat/programs/server/packages/ddp-server.js:903:46
Jun 13 20:22:56 devserv rocketchat[968]:   at [object Object]._.extend.protocol_handlers.method (/opt/rocketchat/Rocket.Chat/programs/server/packages/ddp-server.js:876:21)
Jun 13 20:22:56 devserv rocketchat[968]:   at /opt/rocketchat/Rocket.Chat/programs/server/packages/ddp-server.js:755:85

@localguru
Copy link
Contributor

localguru commented May 30, 2017

If Account locale is set from German to English, sending emails is working. Hmmm .... The error is somewhere in rocketchat_channel-settings-mail-messages.js line 119:

      if (data.language !== 'en') {
        localeFn = Meteor.call('loadLocale', data.language);
        if (localeFn) {
          Function(localeFn)();
        }
      } 

If I change data.language !== 'en' to data.language !== 'de then it's working in DE and not in EN.

I'm not 100% sure, but I think it has to change to

      if (data.language !== 'en') {
        localeFn = Meteor.call('loadLocale', data.language);
        if (localeFn) {
          Function(moment.localeFn)();
        }
      } 

With Function(moment.localeFn)(); mails are sent out. Could someone check that please.

@approximatenumber
Copy link

approximatenumber commented Jun 14, 2017

Same Issue.
Rocket.Chat 0.56.0
LANG=ru_RU.utf-8

Changing in rocketchat_channel-settings-mail-messages.js:
Function(localeFn)(); -> Function(moment.localeFn)(); helps. Thanks @localguru
But I don`t code on js, so I don`t know is it correct edit?..

rasos added a commit to rasos/Rocket.Chat that referenced this issue Jun 14, 2017
@localguru
Copy link
Contributor

My above code doesn't throw an error, but it seems not to be the solution, see #7245

@sampaiodiego
Copy link
Member

duplicated of #5797

@localguru
Copy link
Contributor

Please reopen, #7846 doesn't fix it

@sampaiodiego
Copy link
Member

thanks @localguru .. tested on develop and yes it is still hapenning

@TheReal1604
Copy link
Contributor

@sampaiodiego have you some news on this? a really bad bug - which makes this feature unusable for many users. :(

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