sys-bio / tellurium

Python Environment for Modeling and Simulating Biological Systems
http://tellurium.analogmachine.org/
Apache License 2.0
105 stars 36 forks source link

Very strange libCombine bug? #301

Open 0u812 opened 6 years ago

0u812 commented 6 years ago

I was doing some testing on my Debian 8 VM and I noticed that extractEntryToString only works when the archive is in the cwd. Anyone else run into this? It only seems to occur on this specific version of Linux.

@matthiaskoenig, since you're running Ubuntu, I was wondering if you are able to import the attached COMBINE archive using Import -> Import Combine Archive (OMEX)... from the cell creator bar in the notebook (latest ver 2.0.8). Please let me know if it fails or not.

Attached archive (can rename to .omex or keep as-is): ca-export.zip

0u812 commented 6 years ago

The problem seems to be that you need write access to the working directory when importing a combine archive - not sure if that is because of my code or libCombine, but tellurium does create temp files when importing.

0u812 commented 6 years ago

The initial cwd for the kernel is /opt/Tellurium, which is read-only, so can't import.

matthiaskoenig commented 6 years ago

Hi Kyle, I can run the example without problems on Ubuntu 16.04 via Import -> Import Archive

Also executing the archive directly works te.executeCombineArchive("/home/mkoenig/Desktop/ca-export.omex");

I don't have write access as user to /opt/Tellurium so not sure what is going on there. Normally the files should be created in the system tmp directory (this is where the archives are extracted to work with them), so probably the permissions to the tmp directory are incorrect on the machine. My permissions on /tmp are

drwxrwxrwt 19 root    root    450560 Nov 10 08:56 .

i.e. everybody can read, write, execute in the tmp dir. Check if this is the same on the system. Best M

0u812 commented 6 years ago

Thanks for testing this in your setup. I still have the problem where the extractEntryToString function in libCombine only works if the user has read/write access to the cwd, as shown in the attached notebook. It would be easy enough to fix in Tellurium by simply changing the cwd to /tmp before importing an archive, then changing back again.

libcombine-test.ipynb.zip