-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Mail] sendMail and sendHtmlFail errors for UI rules #11838
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-3-2-release-discussion/130327/30 |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/mail-binding-unsupporteddatatypeexception-error/130530/3 |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/javascript-email-ioexemption/130910/2 |
Hello @jpg0 and @digitaldan, this issue is marked as mail binding issue. But I was able to fix the by just removing the line from the jsscripting binding. After that I was able to send mails again. Line 111 in 71b4fcb
I think it hase something to do with the change for another class loading issues #11222 |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
I'm having this issue with the Groovy scripting. So it seems like it's not specific for the JS scripting. |
OH3.2: I installed the Mail binding because i need to get a reliable way to be alerted to an issue. So I was going to send email-text to my phone. However, I get this problem. Two questions: 1) as this seems like the cleanest solution, is there an ETA on a fix? 2) If no fix coming soon, is there a work around, another option, etc. that can be utilized either permanently or temporarily? |
I am sure there is better or more elegant solutions. But since I did not want to wait with migrating my rules to JS, I have just built myself a quick and dirty workaround by:
That way, I can send emails from any JS rule by using that string item. |
Hi Kstuken, can you post your creation?
Hi Kstuken, can you post your creation? |
@kstuken I'll give it a try. I agree with @martychristensen, it would be nice to see your "creation" for reference. |
@kstuken did I do something wrong or stumble across another issue with javascript in 3.2? In my JS rule, I issue the following command (per documentation)
However, I get:
?? |
It seems like javascript has to many issues. I created a dsl rule to replace my js rule and all is fine. UPDATE: it worked ONCE and then stopped. Now I'm getting:
so I'm back to square one with the Mail binding. @kstaniek can you post how your DSL script is working as I can't get anything related to mail work. |
Sure, if that helps: Here's the item: Here's the command sent in JS script
And here's the DSL rule to pick it up and send the email:
|
@kstuken What version are you running? I'm on
|
I'm on openhab3.2.0 openhabian and it fails under DSL and JS rules too.
Jan 24, 2022 2:29:08 PM Mark Ormesher ***@***.***>:
… @kstuken[https://github.com/kstuken] What version are you running? I'm on *openhab:3.2.0-debian* and get the same error *UnsupportedDataTypeException* even via rules DSL, so it's interesting you're only having problems with JS rules. My rule for reference is:
*rule "Debug: Send Email"
when
// manual trigger only
Item debug_neverChangingValue changed to "this-wont-happen"
then
getActions("mail", "mail:smtp:migadu").sendMail("<email>", "OpenHAB Test Email", "Sent from OpenHAB")
end
*
—
Reply to this email directly, view it on GitHub[#11838 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AJRFDT2YSN6AMB5ZE67WOLLUXWR6ZANCNFSM5KQXWJRA].
Triage notifications on the go with GitHub Mobile for iOS[https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android[https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub].
You are receiving this because you commented. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAYAAABXXxDfAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAmSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAJwY+QwABivJx1AAAAABJRU5ErkJggg==###24x24:true###][Tracking image][https://github.com/notifications/beacon/AJRFDT4OMHKCUM2QXQ6O2PTUXWR6ZA5CNFSM5KQXWJRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHTJQXFQ.gif]
|
I am on OH3.2 on openhabian, and using the JSScripting Add-on (ie ECMAScript 2021+ with the underlying openhab-js library). All my rules, as well as the mail thing definition are files based. |
Notes regarding a quick investigation:
|
@kstuken I'm UI based. Is there some workaround (that doesn't require rewriting the world) to get mail working until a fix can be made? |
Just FYI - the command seems to work fine when running it at startup - I have a rule to send me an email every startup (level 100) and this works. However running the rule manually does not work. |
FYI: My rule is set to run everyday at 5;30. Today it ran and the email was sent. Just when I click "run now" it gets the error. UPDATE: I have the DSL rule triggered by the update of a string item. Every time the item is updated the rule fires and sends the email. However, it is only if I click on "run now" in the UI script editor that it returns:
|
I can confirm this behavior. If the rule is triggered by the trigger (for me it is at a fixed time) the email is sent. If you click on "run now" in the UI you get the error message:
I use a Jython script within the rule.. |
That's because of a different ClassLoader being used in both cases. |
I was hoping that triggering a rule with time would be a good work-around but that's not the case for me. I THOUGHT this had been an intermittent issue for me before and I have just verified that. I set up a test rule to send an email every 5 minutes and I got 5 in a row. So then I tried modifying a temp alert rule to trigger every 5 minutes and it did not work. Then I un-paused the email test rule and it no longer worked. I created a new email test rule and it did not work. This is javascript. |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
Emails started working last night. I have 3 systems running openHABian OH3. I had a test email rule set to send an email on a time trigger (which wasn’t sending any) on one of these systems. I rebooted that system last night and woke up to a bunch of emails. I paused & unpaused the rule & it continues working. So I copied the rule to the other two systems. One started working, the other did not. I rebooted the one that wasn’t sending emails & it’s now working. |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-3-3-milestone-discussion/132715/37 |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/mail-will-not-more-be-send/134230/5 |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/cannot-send-mail-no-protocol/135334/10 |
Expected Behavior
When calling sendMail or sendHtmlMail the email is delivered.
Current Behavior
When calling sendMail the following error occurs:
When calling sendHtmlMail the following error occurs:
In both cases the code is written in JSScripting through the UI. Based on reports (see https://community.openhab.org/t/mail-binding-errors-sending-mail-unsupporteddatatypeexception-text-plaijn-charset-utf-8/130365) the same error occurs in Nashorn and Rules DSL. But there is one report of it working in a .rules file so perhaps the difference is UI verses text file.
Possible Solution
Steps to Reproduce (for Bugs)
Create a Mail thing
Create a UI rule with a script action. Use JavaScript or Rules DSL as the action language and the following line (obviously change the email as appropriate):
actions.get("mail", "mail:smtp:redacted").sendMail("redacted@redacted.com", "Test", "Test")
Watch the logs.
Context
I can no longer get alerts from openHAB via email.
Your Environment
runtimeInfo:
version: 3.3.0
buildString: "Build #2651"
locale: en-US
systemInfo:
configFolder: /openhab/conf
userdataFolder: /openhab/userdata
logFolder: /openhab/userdata/logs
javaVersion: 11.0.13
javaVendor: Azul Systems, Inc.
javaVendorVersion: Zulu11.52+13-CA
osName: Linux
osVersion: 5.4.0-91-generic
osArchitecture: amd64
availableProcessors: 4
freeMemory: 47455416
totalMemory: 855638016
bindings:
clientInfo:
device:
ios: false
android: false
androidChrome: false
desktop: true
iphone: false
ipod: false
ipad: false
edge: false
ie: false
firefox: false
macos: true
windows: false
cordova: false
phonegap: false
electron: false
nwjs: false
webView: false
webview: false
standalone: false
os: macos
pixelRatio: 2
prefersColorScheme: light
isSecureContext: false
locationbarVisible: true
menubarVisible: true
navigator:
cookieEnabled: true
deviceMemory: N/A
hardwareConcurrency: 4
language: en-US
languages:
onLine: true
platform: MacIntel
screen:
width: 1920
height: 1080
colorDepth: 24
support:
touch: false
pointerEvents: true
observer: true
passiveListener: true
gestures: false
intersectionObserver: true
themeOptions:
dark: light
filled: true
pageTransitionAnimation: default
bars: filled
homeNavbar: default
homeBackground: default
expandableCardAnimation: default
userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36
timestamp: 2021-12-21T17:54:28.243Z
Running in Docker.
The text was updated successfully, but these errors were encountered: