On Fri, Nov 19, 2010 at 2:19 PM, Peter Cock <p.j.a.cock@googlemail.com> 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).
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 )
As a changeset: http://bitbucket.org/peterjc/galaxy-central/changeset/1a2b4aacef76 I worked out what was wrong - an early step in my saved workflow was missing a parameter. However, the output from this step was being hidden -- so I was not able to read the error message. Peter