Peter Cock wrote:
Hi all,
In some workflow testing I was getting errors "Unable to cleanup job" which was due to the cleanup method trying to remove non-existent directories. The following patch appears to solve this particular error (although I am still looking into why my workflow was failing).
Thanks Peter, I've committed this. --nate
Peter
Example error (before the patch):
galaxy.jobs ERROR 2010-11-19 13:58:04,806 Unable to cleanup job 150 Traceback (most recent call last): File "/home/pjcock/repositories/galaxy-central/lib/galaxy/jobs/__init__.py", line 614, in cleanup shutil.rmtree( self.working_directory ) File "/usr/local/lib/python2.6/shutil.py", line 204, in rmtree onerror(os.listdir, path, sys.exc_info()) File "/usr/local/lib/python2.6/shutil.py", line 202, in rmtree names = os.listdir(path) OSError: [Errno 2] No such file or directory: './database/job_working_directory/150'
Proposed patch:
diff -r 730b89c4da26 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py Wed Nov 17 18:26:33 2010 +0000 +++ b/lib/galaxy/jobs/__init__.py Fri Nov 19 14:13:45 2010 +0000 @@ -610,7 +610,7 @@ try: for fname in self.extra_filenames: os.remove( fname ) - if self.working_directory is not None: + if self.working_directory and os.path.isdir( self.working_directory ): shutil.rmtree( self.working_directory ) if self.app.config.set_metadata_externally:
self.external_output_metadata.cleanup_external_metadata( self.sa_session ) _______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev