Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenStudio CLI with Radiance - SQL Issue

I'm having issues running the radiance measure from a command line.

The same workflow works fine in PAT and in the OpenStudio GUI.

The first issue pops up when running this line (around line 700):

sql_file = OpenStudio::SqlFile.new(File.join(Dir.pwd, epout_dir, 'run/eplusout.sql'))

In PAT this would create a new folder 'run' within the already created 'epout_dir' and create the sql file in this directory.

In the CLI this doesn't create the folder or the sql file. When I interrogate the sql file in the ruby measure it still lists the path as this directory but the file doesn't exist. The measure fails when attempting to copy the sql file to the radiance directory.

[11:32:44.650347 ERROR] No such file or directory @ rb_sysopen - eplus_preprocess/run/eplusout.sql

I tried to get around this by creating the 'run' directory using a mkdir command. This allows the eplusout.sql to be created (I can see it in the filesystem) but the measure fails as the sql connection does not remain open.

[12:02:50.194347 ERROR] SqlFile c:/test_osw/run/011_radiance_daylighting_measure/eplus_preprocess/run/eplusout.sql connection is not open

Presumably this is some sort of access / permissions issue or maybe a Windows thing. I have probably made a basic error somewhere.

I'm using Windows and OS 2.3.0. I have tried from c:/test_osw and from my dropbox folder.

OpenStudio CLI with Radiance - SQL Issue

I'm having issues running the radiance measure from a command line.

The same workflow works fine in PAT and in the OpenStudio GUI.

The first issue pops up when running this line (around line 700):

sql_file = OpenStudio::SqlFile.new(File.join(Dir.pwd, epout_dir, 'run/eplusout.sql'))

In PAT this would create a new folder 'run' within the already created 'epout_dir' and create the sql file in this directory.

In the CLI this doesn't create the 'run' folder or the sql file. When I interrogate the sql file in the ruby measure it still lists the sql path as this 'run' directory but in the filesystem the file doesn't exist. The measure fails when attempting to copy the sql file to the radiance directory.

[11:32:44.650347 ERROR] No such file or directory @ rb_sysopen - eplus_preprocess/run/eplusout.sql

I tried to get around this by creating the 'run' directory using a mkdir command. This allows the eplusout.sql to be created (I can see it in the filesystem) but the measure fails as the sql connection does not remain open.

[12:02:50.194347 ERROR] SqlFile c:/test_osw/run/011_radiance_daylighting_measure/eplus_preprocess/run/eplusout.sql connection is not open

Presumably this is some sort of access / permissions issue or maybe a Windows thing. I have probably made a basic error somewhere.

Does anyone have success using this measure from CLI? Any suggestions to resolve? When I get a chance I will set up a virtual linux machine to test.

I'm using Windows and OS OpenStudio 2.3.0. I have tried from c:/test_osw and from my dropbox folder. folder.

OpenStudio CLI with Radiance - SQL Issue

I'm having issues running the radiance measure from a command line.

The same workflow works fine in PAT and in the OpenStudio GUI.

The first issue pops up when running this line within the radiance measure (around line 700):

sql_file = OpenStudio::SqlFile.new(File.join(Dir.pwd, epout_dir, 'run/eplusout.sql'))

In PAT this would create a new folder 'run' within the already created 'epout_dir' and create the sql file in this directory.

In the CLI this doesn't create the 'run' folder or the sql file. When I interrogate the sql file in the ruby measure it still lists the sql path as this 'run' directory but in the filesystem the file doesn't exist. The measure fails when attempting to copy the sql file to the radiance directory.

[11:32:44.650347 ERROR] No such file or directory @ rb_sysopen - eplus_preprocess/run/eplusout.sql

I tried to get around this by creating the 'run' directory using a mkdir command. This allows the eplusout.sql to be created (I can see it in the filesystem) but the measure fails as the sql connection does not remain open.

[12:02:50.194347 ERROR] SqlFile c:/test_osw/run/011_radiance_daylighting_measure/eplus_preprocess/run/eplusout.sql connection is not open

Presumably this is some sort of access / permissions issue or maybe a Windows thing. I have probably made a basic error somewhere.

Does anyone have success using this measure from CLI? Any suggestions to resolve? When I get a chance I will set up a virtual linux machine to test.

I'm using Windows and OpenStudio 2.3.0. I have tried from c:/test_osw and from my dropbox folder.

OpenStudio CLI with Radiance - SQL Issue

I'm having issues running the radiance measure from a command line.

The same workflow works fine in PAT and in the OpenStudio GUI.

The first issue pops up when running this line within the radiance measure (around line 700):

sql_file = OpenStudio::SqlFile.new(File.join(Dir.pwd, epout_dir, 'run/eplusout.sql'))

In PAT this would create a new folder 'run' within the already created 'epout_dir' and create the sql file in this directory.

In the CLI this doesn't create the 'run' folder or the sql file. When I interrogate the sql file in the ruby measure it still lists the sql path as this 'run' directory but in the filesystem the file doesn't exist. The measure fails when attempting to copy the sql file to the radiance directory.

[11:32:44.650347 ERROR] No such file or directory @ rb_sysopen - eplus_preprocess/run/eplusout.sql

I tried to get around this by creating the 'run' directory using a mkdir command. This allows the eplusout.sql to be created (I can see it in the filesystem) but the measure fails as the sql connection does not remain open.

[12:02:50.194347 ERROR] SqlFile c:/test_osw/run/011_radiance_daylighting_measure/eplus_preprocess/run/eplusout.sql connection is not open

Presumably this is some sort of access / permissions issue or maybe a Windows thing. I have probably made a basic error somewhere.

Does anyone have success using this measure from CLI? Any suggestions to resolve? When I get a chance I will set up a virtual linux machine to test.

I'm using Windows and OpenStudio 2.3.0. I have tried from c:/test_osw and from my dropbox folder.

OpenStudio CLI with Radiance - SQL Issue

I'm having issues running the radiance measure from a command line.

The same workflow works fine in PAT and in the OpenStudio GUI.

The first issue pops up when running this line within the radiance measure (around line 700):

sql_file = OpenStudio::SqlFile.new(File.join(Dir.pwd, epout_dir, 'run/eplusout.sql'))

In PAT this would create a new folder 'run' within the already created 'epout_dir' and create the sql file in this directory.

In the CLI this doesn't create the 'run' folder or the sql file. When I interrogate the sql file in the ruby measure it still lists the sql path as this 'run' directory but in the filesystem the file doesn't exist. The measure fails when attempting to copy the sql file to the radiance directory.

[11:32:44.650347 ERROR] No such file or directory @ rb_sysopen - eplus_preprocess/run/eplusout.sql

I tried to get around this by creating the 'run' directory using a mkdir command. This allows the eplusout.sql to be created (I can see it in the filesystem) but the measure fails as the sql connection does not remain open.

[12:02:50.194347 ERROR] SqlFile c:/test_osw/run/011_radiance_daylighting_measure/eplus_preprocess/run/eplusout.sql connection is not open

Presumably this is some sort of access / permissions issue or maybe a Windows thing. I have probably made a basic error somewhere.

Does anyone have success using this measure from CLI? Any suggestions to resolve? When I get a chance I will set up a virtual linux machine to test.

I'm using Windows and OpenStudio 2.3.0. I have tried from c:/test_osw and from my dropbox folder.


UPDATE 26 June 2018

I longer think that SQL is the root cause of this (but who knows, really). Since this post I have tried the following:

  1. The original post was on a Friday, on a work computer - possibly relevant as updates may have occurred over the weekend.
  2. On the Monday I installed OpenStudio 2.4.0 and tested (before trying to repeat Friday's attempts on OpenStudio 2.3.0). This failed with a message Exception: Embedded file not found ':c:/ruby/2.2.0/gems/openstudio-workflow-1.3.1/lib/openstudio/workflow/version.rb' eval:81:in 'getFileAsString': unexpected return This error message was received without the workflow running at all. When I tried with OpenStudio versions 2.2.0, 2.3.0 and 2.5.0 the same errors popped up. No workflow would run.
  3. I tried installing various OpenStudio versions on my home laptop (which has had various versions of OpenStudio over the years) and the same 'Embedded file not found' exception popped up
  4. On my home laptop I installed ruby 2.2.4 and tested again (without changing any paths) and the workflow ran, but this time I noticed the 'embedded file not found' exception buried within the outputs of the workflow. The workflow failed as per the original post. It is possible the runs on Friday contained this exception without me noticing
  5. On the work computer I tried using the --include switch to direct openstudio to C:\openstudio-2.3.0\Ruby (yes back on 2.3.0) openstudio.exe -I C:\openstudio-2.3.0\Ruby run -w c:\test_osw\test.osw. This ran the workflow but had the same exception and fail point as item 4 above.
  6. I tried again with the exact same input as item 5 above and the workflow did NOT run this time and just returned the exception.

I haven't run on linux yet (soon).

So far I've learnt the following: 1. I'm operating well outside area of my expertise 2. This may be some sort of ruby path issue 3. The issue is possibly due to installing various versions of OpenStudio 4. The error messages are annoyingly inconsistent (perhaps user error)

I'm not really expecting a direct solution, I just wanted to post a follow up in case anyone is having similar issues.

I'll keep tinkering and post if I have an update.