santoshphilip / eppy

scripting language for E+, Energyplus
MIT License
155 stars 67 forks source link

returned non-zero exit status 1 Error #204

Open oroojlooy opened 6 years ago

oroojlooy commented 6 years ago

Hi,

I can run the following model in command line using the energyplus, but I get returned non-zero exit status 1 error in Eppy.

./energyplus-8.9.0 -i PreProcess/IDFVersionUpdater/V8-9-0-Energy+.idd -w USA_IL_Chicago-OHare.725300_TMY2.epw ExampleFiles/AirCooledElectricChiller.idf which returns me:

irCooledElectricChiller.idf 
EnergyPlus Starting
EnergyPlus, Version 8.9.0-40101eaafd, YMD=2018.06.05 09:34
Adjusting Air System Sizing
Adjusting Standard 62.1 Ventilation Sizing
Initializing Simulation
Reporting Surfaces
Beginning Primary Simulation
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 01/21 for CHICAGO OHARE INTL AP ANN HTG 99% CONDNS DB
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 07/21 for CHICAGO OHARE INTL AP ANN CLG 1% CONDNS DB=>MWB
Writing tabular output file results using HTML format.
EnergyPlus Completed Successfully.

In Eppy I set

iddfile = "/usr/local/EnergyPlus-8-9-0/PreProcess/IDFVersionUpdater/V8-9-0-Energy+.idd"
IDF.setiddname(iddfile)

idfname = "/usr/local/EnergyPlus-8-9-0/ExampleFiles/AirCooledElectricChiller.idf"
epwfile = "/usr/local/EnergyPlus-8-9-0/USA_IL_Chicago-OHare.725300_TMY2.epw"

idf = IDF(idfname, epwfile)

and idf.run() returns:

`CalledProcessError                        Traceback (most recent call last)
<ipython-input-5-b1067f633f9f> in <module>()
----> 1 idf.run()
      2 # dir(idf)

/usr/local/lib/python2.7/dist-packages/eppy/modeleditor.pyc in run(self, **kwargs)
   1002         self.saveas('in.idf')
   1003         # run EnergyPlus
-> 1004         run(self, self.epw, **kwargs)
   1005         # remove in.idf
   1006         os.remove('in.idf')

/usr/local/lib/python2.7/dist-packages/eppy/runner/run_functions.pyc in run(idf, weather, output_directory, annual, design_day, idd, epmacro, expandobjects, readvars, output_prefix, output_suffix, version, verbose, ep_version)
    236     try:
    237         if verbose == 'v':
--> 238             check_call(cmd)
    239         elif verbose == 'q':
    240             check_call(cmd, stdout=open(os.devnull, 'w'))

/usr/lib/python2.7/subprocess.pyc in check_call(*popenargs, **kwargs)
    188         if cmd is None:
    189             cmd = popenargs[0]
--> 190         raise CalledProcessError(retcode, cmd)
    191     return 0
    192 

CalledProcessError: Command '[u'/usr/local/EnergyPlus-8-9-0/energyplus', u'--output-directory', u'/home/afshin/Eplus', u'--weather', '/usr/local/EnergyPlus-8-9-0/USA_IL_Chicago-OHare.725300_TMY2.epw', u'/home/afshin/Eplus/in.idf']' returned non-zero exit status 1
jamiebull1 commented 6 years ago

@oroojlooy does EnergyPlus create a .err file?

oroojlooy commented 6 years ago

yes, these are the list of the output when I directly run energyplus:

-rw-r--r-- 1 afshin afshin   1672 Jun  5 10:09 eplusout.audit
-rw-r--r-- 1 afshin afshin  47959 Jun  5 10:09 eplusout.bnd
-rw-r--r-- 1 afshin afshin  18831 Jun  5 10:09 eplusout.eio
-rw-r--r-- 1 afshin afshin     97 Jun  5 10:09 eplusout.end
-rw-r--r-- 1 afshin afshin    883 Jun  5 10:09 eplusout.err
-rw-r--r-- 1 afshin afshin 120341 Jun  5 10:09 eplusout.eso
-rw-r--r-- 1 afshin afshin   2946 Jun  5 10:09 eplusout.mdd
-rw-r--r-- 1 afshin afshin  21949 Jun  5 10:09 eplusout.mtd
-rw-r--r-- 1 afshin afshin   3261 Jun  5 10:09 eplusout.mtr
-rw-r--r-- 1 afshin afshin  28942 Jun  5 10:09 eplusout.rdd
-rw-r--r-- 1 afshin afshin   4813 Jun  5 10:09 eplusout.shd
-rw-r--r-- 1 afshin afshin 251973 Jun  5 10:09 eplustbl.htm
-rw-r--r-- 1 afshin afshin      0 Jun  5 10:09 sqlite.err

which the error file is empty.

jamiebull1 commented 6 years ago

Ok. So what's in the .err file? That should give us a clue

oroojlooy commented 6 years ago

That is empty. These are the results when I use ./energyplus-8.9.0 -i PreProcess/IDFVersionUpdater/V8-9-0-Energy+.idd -w USA_IL_Chicago-OHare.725300_TMY2.epw ExampleFiles/AirCooledElectricChiller.idf, which runs fine and as a result the .err file is empty. When I call eppy, the same sqlite.err file is generated and it is also empty.

jamiebull1 commented 6 years ago

Sorry, I meant the eplusout.err file

oroojlooy commented 6 years ago

When I run eppy, eplusout.err is not generated. When I call directly energyplus, eplusout.err contains:

Program Version,EnergyPlus, Version 8.9.0-40101eaafd, YMD=2018.06.05 10:24,
   ************* Testing Individual Branch Integrity
   ************* All Branches passed integrity testing
   ************* Testing Individual Supply Air Path Integrity
   ************* All Supply Air Paths passed integrity testing
   ************* Testing Individual Return Air Path Integrity
   ************* All Return Air Paths passed integrity testing
   ************* No node connection errors were found.
   ************* Beginning Simulation
   ************* Simulation Error Summary *************
   ************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
   ************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
   ************* EnergyPlus Completed Successfully-- 0 Warning; 0 Severe Errors; Elapsed Time=00hr 00min  0.75sec
jamiebull1 commented 6 years ago

Ok. Can you check if all these paths/files actually exist on your system then? Usually if EnergyPlus doesn't get as far as producing an eplusout.err file it's because of some path error.

'/usr/local/EnergyPlus-8-9-0/energyplus' '/home/afshin/Eplus' '/usr/local/EnergyPlus-8-9-0/USA_IL_Chicago-OHare.725300_TMY2.epw' '/home/afshin/Eplus/in.idf'

oroojlooy commented 6 years ago

They exists. I think I found the problem. When I commented

# idf.newidfobject('Output:Table:SummaryReports'.upper(), Report_1_Name="AllSummary")
# idf.newidfobject('OUTPUTCONTROL:TABLE:STYLE'.upper(), Column_Separator='HTML', Unit_Conversion='None')

it works fine. It is strange, since it gives error for this model file. For example if I select "/usr/local/EnergyPlus-8-9-0/ExampleFiles/BasicsFiles/Exercise1A.idf", it runs fine.

jamiebull1 commented 6 years ago

That is strange. I'll see if I can reproduce the error this evening, and look into it further.

oroojlooy commented 6 years ago

Thanks

jamiebull1 commented 6 years ago

@oroojlooy I can't reproduce this on my Windows machine. It runs fine. Could you post the IDF and EPW files you're using when you hit the error?

santoshphilip commented 5 years ago

Begri,    I am not seeing your comment on GitHub (in issue #204). I am replying from my email to see if it pops up on the GitHub page. Santosh On Wednesday, January 9, 2019, 2:07:18 AM PST, Begri notifications@github.com wrote:

Hello, I am experiencing the same problem on Mac OS. I have an idf that can be run without problems on EP-Launch, but when I try to run it through eppy I get the following error:

Traceback (most recent call last): File "", line 1, in File "/Users/ben/virtualenvs/EDINET/lib/python2.7/site-packages/eppy/modeleditor.py", line 1014, in run run(self, weather=epw, idd=idd, **kwargs) File "/Users/ben/virtualenvs/EDINET/lib/python2.7/site-packages/eppy/runner/run_functions.py", line 316, in run check_call(cmd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '[u'/Applications/EnergyPlus-8-7-0/energyplus', u'--output-directory', u'/private/var/folders/kj/db1yz5xs6yq4kg2vkzv8fv580000gn/T/tmpnqdBLU', u'--expandobjects', u'--weather', '/Users/ben/Dropbox/PhD/Energy_plus_simulations/weather_data/barcelona_2016.epw', u'--idd', '/Applications/EnergyPlus-8-7-0/Energy+.idd', u'--readvars', u'/private/var/folders/kj/db1yz5xs6yq4kg2vkzv8fv580000gn/T/tmpnqdBLU/in.idf']' returned non-zero exit status 1

Any solutions as of now? Thanks in advance

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

bgrillone commented 5 years ago

Hey, I deleted the comment because I found a solution shortly after. The problem was that the schedule files I called in the idf were not in the current work directory of python.

santoshphilip commented 5 years ago

got you.

santoshphilip commented 5 years ago

Next time, add an additional comment saying that you found the solution. That will keep the comment trial on the issue clear. I spent some time thinking the the gihub issues code was broken :-)

yahyasheikhnejad commented 5 years ago

Dear @santoshphilip and @jamiebull1 the same error (returned non-zero exit status 1) I have encountered recently and I do not know what is its origin. The eppy module is updated and I am using EnergyPlus, Version 9.1.0-08d2e308bb. These files are in the same directory (C:/Yahya/EP/Yahya Model): 1- Energy+.idd [copy and paste from C:\EnergyPlusV9-1-0] 2- USA_CA_San_Francisco.epw [copy and paste from C:\EnergyPlusV9-1-0\WeatherData] 3- RoomVRF_Fanger.idf [this file is simulated without any error (attached file)] RoomVRF_Fanger.err.txt]

and idf.run() results in this error message.

FATAL:Errors occurred on processing input file. Preceding condition(s) cause termination. EnergyPlus Run Time=00hr 00min 0.22sec Program terminated: EnergyPlus Terminated--Error(s) Detected. Traceback (most recent call last): File "Yeppy-1.py", line 31, in idf.run() File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\site-packages\eppy\modeleditor.py", line 1004, in run run(self, self.epw, kwargs) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\site-packages\eppy\runner\run_functions.py", line 239, in run check_call(cmd) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['C:/EnergyPlusV9-1-0\energyplus.exe', '--output-directory', 'C:\Yahya\EP\Yahya Model', '--weather', 'C:\Yahya\EP\Yahya Model\USA_CA_San_Francisco.epw', 'C:\Yahya\EP\Yahya Model\in.idf']' returned non-zero exit status 1.

jamiebull1 commented 5 years ago

@yahyasheikhnejad Can you try running with the verbose option set? idf.run(verbose="v")

jamiebull1 commented 5 years ago

It looks like an error in the IDF though. Can you run it directly from EPLaunch?

yahyasheikhnejad commented 5 years ago

It looks like an error in the IDF though. Can you run it directly from EP-Launch?

Dear @jamiebull1 First of all, I acknowledge your kindness to respond to me rapidly. yes! with no error! I attached the error file generated by EP-Launch in the first comment.

Simulation Error Summary: EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors. EnergyPlus Sizing Error Summary. During Sizing: 3 Warning; 0 Severe Errors. EnergyPlus Completed Successfully-- 4 Warning; 0 Severe Errors;

yahyasheikhnejad commented 5 years ago

@yahyasheikhnejad Can you try running with the verbose option set? idf.run(verbose="v")

Code:

import os import sys from eppy import *
from eppy import modeleditor from eppy.modeleditor import IDF os.chdir("C:/Yahya/EP/Yahya Model") iddfile = "Energy+.idd" IDF.setiddname(iddfile) epwfile = "USA_VA_Sterling-Washington.Dulles.Intl.AP.724030_TMY3.epw" fname = "RoomVRF_Fanger.idf" idf = IDF(fname, epwfile) idf.run(verbose="v")

Result:

cmd = ['C:/EnergyPlusV9-1-0\energyplus.exe', '--output-directory', 'C:\Yahya\EP\Yahya Model', '--weather', 'C:\Yahya\EP\Yahya Model\USA_VA_Sterling-Washington.Dulles.Intl.AP.724030_TMY3.epw', 'C:\Yahya\EP\Yahya Model\in.idf'] EnergyPlus Starting EnergyPlus, Version 9.1.0-08d2e308bb, YMD=2019.06.24 14:28 FATAL:Errors occurred on processing input file. Preceding condition(s) cause termination. EnergyPlus Run Time=00hr 00min 0.22sec Program terminated: EnergyPlus Terminated--Error(s) Detected. Traceback (most recent call last): File "Yeppy2.py", line 23, in idf.run(verbose="v") File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\site-packages\eppy\modeleditor.py", line 1004, in run run(self, self.epw, kwargs) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\site-packages\eppy\runner\run_functions.py", line 239, in run check_call(cmd) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['C:/EnergyPlusV9-1-0\energyplus.exe', '--output-directory', 'C:\Yahya\EP\Yahya Model', '--weather', 'C:\Yahya\EP\Yahya Model\USA_VA_Sterling-Washington.Dulles.Intl.AP.724030_TMY3.epw', 'C:\Yahya\EP\Yahya Model\in.idf']' returned non-zero exit status 1.

yahyasheikhnejad commented 5 years ago

@jamiebull1 @santoshphilip

In fact, I do not understand the meaning of "returned non-zero exit status 1" while all files are available in the specified directory and IDF file can be run without any fatal error, which kind of mistake can result in this error? HTML result of simulation: Y Building RUNPERIOD 1 __ Washington Dc Dulles IntL Ar VA USA TMY3 WMO#=724030 2019-06-24 14_52_13 - EnergyPlus.pdf

jamiebull1 commented 5 years ago

Could be related to postprocessing, or could be a bug in the IDF.run code. I can try to reproduce the error if you can share the input files.

yahyasheikhnejad commented 5 years ago

Could be related to postprocessing, or could be a bug in the IDF.run code. I can try to reproduce the error if you can share the input files.

Dear @jamiebull1 of course, I can. How can I share these files? here .RAR file is not acceptable. I can send them via email. is there any other way to share a bunch of files?

yahyasheikhnejad commented 5 years ago

https://drive.google.com/file/d/1DPISgXgX2JG3a5EFqol2K5rKBPRY98hQ/view?usp=sharing

jamiebull1 commented 5 years ago

@yahyasheikhnejad ok, first problem is that you need to call idf.run with the expandobjects=True keyword arg. This is required to expand your HVAC templates. There is also an underlying issue with how we're handling the error, which I'll raise as a separate issue.

yahyasheikhnejad commented 5 years ago

@yahyasheikhnejad ok, first problem is that you need to call idf.run with the expandobjects=True keyword arg. This is required to expand your HVAC templates. There is also an underlying issue with how we're handling the error, which I'll raise as a separate issue.

Dear @jamiebull1 Thank you so much for your help and support

yahyasheikhnejad commented 5 years ago

@yahyasheikhnejad ok, first problem is that you need to call idf.run with the expandobjects=True keyword arg. This is required to expand your HVAC templates. There is also an underlying issue with how we're handling the error, which I'll raise as a separate issue.

Dear @jamiebull1 I am not sure if I follow your instruction well (as you may expect) but after I applied your instruction I got this result:

ExpandObjects Started. Begin reading Energy+.idd file. Done reading Energy+.idd file. ExpandObjects Finished. Time: 0.125 EnergyPlus Starting EnergyPlus, Version 9.1.0-08d2e308bb, YMD=2019.06.25 19:58 FATAL:ProcessScheduleInput: Preceding Errors cause termination. EnergyPlus Run Time=00hr 00min 0.28sec Program terminated: EnergyPlus Terminated--Error(s) Detected. Traceback (most recent call last): File "Yeppy2.py", line 65, in idf.run(expandobjects=True) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\site-packages\eppy\modeleditor.py", line 1004, in run run(self, self.epw, kwargs) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\site-packages\eppy\runner\run_functions.py", line 239, in run check_call(cmd) File "C:\Users\yahya\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['C:/EnergyPlusV9-1-0\energyplus.exe', '--expandobjects', '--output-directory', 'C:\Yahya\EP\Yahya Model3\run', '--weather', 'C:\Yahya\EP\Yahya Model3\run\USA_VA_Sterling-Washington.Dulles.Intl.AP.724030_TMY3.epw', 'C:\Yahya\EP\Yahya Model3\run\in.idf']' returned non-zero exit status 1.

jamiebull1 commented 5 years ago

The FATAL:ProcessScheduleInput part of the error message suggests that the problem is related to your schedules. Have a look in the .err file which should have more info. Given that the model runs in EPLaunch, I guess that they're not in the expected directory when running eppy.