-
Notifications
You must be signed in to change notification settings - Fork 192
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
Internal Logging Issue with OpenStudio 3.7 when it is Installed in a Path with a Space (eg. C:\Program Files\openstudio) #5108
Comments
Yeah ok, I can reproduce (on mac here). Thanks for the details and the sleuthing @chriswmackey ! My money is on the call to ExpandObjects (That stupid fortran utility) |
Bingo! (or "Yatzee!" I guess as you say in the US).
|
OpenStudio/src/workflow/RunEnergyPlus.cpp Lines 157 to 167 in c48911e
@chriswmackey So unless you have HVACTemplate:XXXX objects in your IDF, you should be fine... |
MCVE, even with your openstudio installed without a space
|
Thanks, @jmarrec . Good to know. I guess that's why we always experienced the EnergyPlus simulation succeeding since we never use the HVACTemplate objects in our workflows with OpenStudio CLI. I'm sensing that addressing this call to Expand Objects may not fix the lack of the reporting measure progress but at least this will prevent us from getting a cryptic message. So it's progress. |
@chriswmackey either use the classic CLI, or Use "--show-stdout" (and capture it) (and optionally --style-stdout) when using the C++ CLI. This is what wer're doing for the OpenStudioApplication when using the C++ CLI (while we used the socket adapter for the legacy CLI). Example
You can also add |
@chriswmackey should be fixed by #5109 . When the windows binary is available (< 1 hour), I'd appreciate if you could test it. |
Thanks, @jmarrec . This is excellent. The I will test the new build once it is available, though I see that merging is currently blocked. I'll keep an eye out for any updates but just mention my GitHub handle here again if I'm late in seeing it. |
@chriswmackey the binary will be in this post: #5109 (comment) |
Ah, disregard my last comment. I see you just want me to grab the build from the CI. So there's no need to have the PR merged to get the build. I'll just need to wait for the Windows version to finish building here. |
Hey @jmarrec . I can see that the Windows build finished but clicking on the .exe doesn't seem to start the download. Is there something that I'm missing here? |
Nevermind. I think it was just a bothersome security feature in Chrome that was not letting my download executables from addresses that didn't start with https. I have the exe now. |
Thanks, @jmarrec . I tested it with the lasted build from the CI and I can confirm that everything works as expected when it's installed in a path with a space: And the --show-stdout gives me exactly what I need: Feel free to close the issue when ready. |
Thanks for testing! |
Fix #5108 - quote call to ExpandObjects for paths with spaces
Issue overview
I am opening this issue primarily for @jmarrec after asking an initial question on another issue. The issue is that, whenever OpenStudio is installed in a file path with a space (for example, the
C:\Program Files
directory that IT departments make us use), we get the following message when running an OSW with a reporting measure using OpenStudio CLI:Current Behavior
The message does not indicate a complete OpenStudio CLI failure since the OSW run still completes successfully, including a successful run of EnergyPlus and the creation of reports from reporting measures specified in the OSW. However, it seems that whatever part of the OpenStudio 3.7 code that is producing this exception prevents us from seeing the progress of the reporting measure, whether it's the log of steps running in the measure or any adapters specified in the OSW, like those that allow us to see the progress of the EnergyPlus simulation as the OSW is being run.
Expected Behavior
In OpenStudio 3.6.1, we did not get this message about "'C:/Program' is not recognized as an internal or external command," and we would instead see the logs of the reporting measure being run as well as the adapter we use giving us a full report of the EnergyPlus simulation as it was run. For example, at a minimum, we would see the following:
... and, if we had an adapter specified in the OSW, we would see the full EnergyPlus progress.
Steps to Reproduce
I know that @jmarrec is not a Windows user so I think he may be able to create the issue on his end just by installing OpenStudio in a path with a space in it and trying to run the OpenStudio Results measure on any model (using the
/path with spaces/openstudio/bin/openstudio
to call the OpenStudio CLI executable). With this, I think he should be able to see the exception message and at least figure out where it is coming from with the OpenStudio code without the need to do a whole Windows setup. Also, he should not need to set up an adapter in the OSW or do anything fancy just to see this initial problem. The issue appears to be more deeply related to the ability to log the progress of reporting measures and not specific to the adapter as I originally thought.If anyone else wants to recreate the issue or if my suggestion above does not work, I have a minimal OSW file that will work on Windows as long as the OpenStudio executable is installed in
C:\Program Files\openstudio\bin\openstudio.exe
(or another path with a space in it). Here is the zip file of the sample:https://drive.google.com/file/d/16Rb6gnid0JOxPlcLd78du7F0A5R96x3J/view?usp=sharing
And, if you extract it, this is what you should see:
You have a small shoe box OSM, a Boston EPW and a workflow.osw that is meant to run only the OpenStudio Results measure, all out of a C:\test_osm` directory. Here are the contents of that simple OSW JSON:
Just run the OSW using:
... and you should see the issue.
Possible Solution
I have a feeling that all that is needed to fix this issue is that the path to a file or folder needs to be put in "double quotes" somewhere in the OpenStudio code. This way, the full path will be interpreted by the command line and it won't try to interpret 'C:/Program' as a command.
Environment
I'm running on Windows 10 but, as I said, I think any OpenStudio installation with a space in the path should illustrate the issue.
Context
This is not a deal breaker for us upgrading to OpenStudio 3.7 since, as I said, the OSW files are still running and producing the correct outputs. However, several of our users are starting to complain that "OpenStudio is frozen" since they can't see any logging or progress of the reporting measure. Here is an example.
Thanks, as always.
The text was updated successfully, but these errors were encountered: