<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sendemail returned error code 1 in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72769#M1657</link>
    <description>&lt;P&gt;Hi you may have encountered this new bug&lt;BR /&gt;
SPL-48993 "Windows 2008 - sendemail fails if user is not using default server timezone "&lt;/P&gt;

&lt;P&gt;The user running the search is using a different timezone than the server, see manager &amp;gt; your account&lt;/P&gt;

&lt;P&gt;It produces this error in splunkd.log&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
03-05-2012 16:07:45.240 -0500 ERROR ScriptRunner - stderr from 'D:\Program Files\Splunk\etc\apps\search\bin\sendemail.py':  ImportError: DLL load failed: %1 is not a valid Win32 application.&lt;BR /&gt;
03-05-2012 16:07:45.490 -0500 ERROR script - External search command 'sendemail' returned error code 1.&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The fix is not yet available,&lt;BR /&gt;
the temporary workarounds are to  :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;change the timezone for the user running those searches to "default system timezone"&lt;/LI&gt;
&lt;LI&gt;or schedule the email alerts from another splunk search-head, on another OS (not Windows 2008) or another version (not 4.3.* )&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Fri, 09 Mar 2012 02:31:38 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2012-03-09T02:31:38Z</dc:date>
    <item>
      <title>sendemail returned error code 1</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72765#M1653</link>
      <description>&lt;P&gt;Whenever I attempt to pipe results to the sendemail function, I get the following error:&lt;/P&gt;

&lt;P&gt;External search command 'sendemail' returned error code 1. &lt;/P&gt;

&lt;P&gt;Here's an example of the command I use:&lt;/P&gt;

&lt;P&gt;error OR failure OR severe | sendemail to=myemail sendresults=true server=mysmtpgateway from=myemail format=text &lt;/P&gt;

&lt;P&gt;I can confirm via direct telnet that my smtpgateway server is responding and accepting emails. Ideas? What does error code 1 mean in this context?   Is this a python problem?   Where can I look for more log details? (I've set "EmailSender" log level to DEBUG but I'm not sure how to find the output.)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 13:26:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72765#M1653</guid>
      <dc:creator>pde7</dc:creator>
      <dc:date>2012-02-16T13:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail returned error code 1</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72766#M1654</link>
      <description>&lt;P&gt;We are having the same problem.  &lt;/P&gt;

&lt;P&gt;Splunk 4.3, Windows 2008 R2 fully patched.  Splunk is running as a domain user with local admin privileges (even added all the security privileges required).  Splunk's installed on the &lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; drive.&lt;/P&gt;

&lt;P&gt;When I pipe results to 'sendemail' with all the appropriate settings I receive:&lt;/P&gt;

&lt;P&gt;"External search command 'sendemail' returned error code 1."&lt;/P&gt;

&lt;P&gt;We've rebuilt the OS, and even installed Splunk on a Windows 7 VM and the 'sendemail' command works just fine.&lt;/P&gt;

&lt;P&gt;The 'splunkd.log' contains the following:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;02-16-2012 10:40:26.759 -0800 ERROR&lt;BR /&gt;
ScriptRunner - stderr from&lt;BR /&gt;
'D:\Splunk\etc\apps\search\bin\sendemail.py':&lt;BR /&gt;
ImportError: No module named site&lt;BR /&gt;
02-16-2012 10:40:26.759 -0800 ERROR&lt;BR /&gt;
ScriptRunner - extern write error:&lt;BR /&gt;
errno=The pipe is being closed.&lt;BR /&gt;
02-16-2012 10:40:26.790 -0800 ERROR&lt;BR /&gt;
script - External search command&lt;BR /&gt;
'sendemail' returned error code 1.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I added a 'PYTHONPATH' env. variable and pointed it to D:\Splunk\Python-2.7\lib, which caused the logged errors to change.  Definitely something strange going on with the Python environment.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 18:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72766#M1654</guid>
      <dc:creator>farleymike</dc:creator>
      <dc:date>2012-02-16T18:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail returned error code 1</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72767#M1655</link>
      <description>&lt;P&gt;I tried calling the sendemail.py directly and I'm getting library import errors:  &lt;/P&gt;

&lt;P&gt;D:\Splunk\etc\apps\search\bin&amp;gt;python sendemail.py&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
  File "sendemail.py", line 2, in &lt;MODULE&gt;&lt;BR /&gt;
    import re,sys,time,logging,splunk.Intersplunk, splunk.mining.dcutils as dcu&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
  File "D:\Splunk\Python-2.7\lib\site-packages\splunk\clilib\cli_common.py", line 6, in &lt;MODULE&gt;&lt;BR /&gt;
    import lxml.etree as etree&lt;BR /&gt;
ImportError: DLL load failed: %1 is not a valid Win32 application.&lt;/MODULE&gt;&lt;/MODULE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2012 20:29:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72767#M1655</guid>
      <dc:creator>pde7</dc:creator>
      <dc:date>2012-02-21T20:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail returned error code 1</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72768#M1656</link>
      <description>&lt;P&gt;We were having the same problem with sendemail not working after upgrading to 4.3 and stayed broken in 4.3.1.  After much troubleshooting, I discovered that the issue was with one of the new features in 4.3 which allowed each user in Splunk to set what timezone they are in.  After the upgrade, I had changed my timezone to try the new feature, and didn't realize that it immediately broke sendemail.  So, I changed my timezone back to default under Manager-&amp;gt;Your Account, and sendemail worked again.&lt;/P&gt;

&lt;P&gt;This bug has been reported to Splunk support and will hopefully get fixed in a future release.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2012 23:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72768#M1656</guid>
      <dc:creator>Justin</dc:creator>
      <dc:date>2012-03-08T23:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail returned error code 1</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72769#M1657</link>
      <description>&lt;P&gt;Hi you may have encountered this new bug&lt;BR /&gt;
SPL-48993 "Windows 2008 - sendemail fails if user is not using default server timezone "&lt;/P&gt;

&lt;P&gt;The user running the search is using a different timezone than the server, see manager &amp;gt; your account&lt;/P&gt;

&lt;P&gt;It produces this error in splunkd.log&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
03-05-2012 16:07:45.240 -0500 ERROR ScriptRunner - stderr from 'D:\Program Files\Splunk\etc\apps\search\bin\sendemail.py':  ImportError: DLL load failed: %1 is not a valid Win32 application.&lt;BR /&gt;
03-05-2012 16:07:45.490 -0500 ERROR script - External search command 'sendemail' returned error code 1.&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The fix is not yet available,&lt;BR /&gt;
the temporary workarounds are to  :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;change the timezone for the user running those searches to "default system timezone"&lt;/LI&gt;
&lt;LI&gt;or schedule the email alerts from another splunk search-head, on another OS (not Windows 2008) or another version (not 4.3.* )&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 09 Mar 2012 02:31:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72769#M1657</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-03-09T02:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: sendemail returned error code 1</title>
      <link>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72770#M1658</link>
      <description>&lt;P&gt;Thanks for the update to this issue.  We ended up moving Splunk from Windows to Ubuntu for other reasons, but it's nice to know the cause and a temporary workaround.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2012 02:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/sendemail-returned-error-code-1/m-p/72770#M1658</guid>
      <dc:creator>farleymike</dc:creator>
      <dc:date>2012-03-09T02:40:50Z</dc:date>
    </item>
  </channel>
</rss>

