Skip to content
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

builtins.KeyError: 'stat' when file is not existing #5058

Closed
tardyp opened this issue Oct 24, 2019 · 0 comments · Fixed by #5059
Closed

builtins.KeyError: 'stat' when file is not existing #5058

tardyp opened this issue Oct 24, 2019 · 0 comments · Fixed by #5059
Labels

Comments

@tardyp
Copy link
Member

tardyp commented Oct 24, 2019

As per:
https://build.contextgarden.net/#/builders/13/builds/55

builtins.KeyError: 'stat'
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/buildbot/process/buildstep.py:567 in startStep
566                    self._running = True
567                    self.results = yield self.run()
568                finally:
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/twisted/internet/defer.py:1418 in _inlineCallbacks
1417            else:
1418                result = g.send(result)
1419        except StopIteration as e:
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/buildbot/process/buildstep.py:697 in run
696                self._start_deferred.callback(results)
697            results = yield self._start_deferred
698        finally:
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/twisted/internet/defer.py:1416 in _inlineCallbacks
1415            if isFailure:
1416                result = result.throwExceptionIntoGenerator(g)
1417            else:
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/twisted/python/failure.py:512 in throwExceptionIntoGenerator
511        # is done in _findFailure.
512        return g.throw(self.type, self.value, self.tb)
513
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/buildbot/steps/transfer.py:397 in uploadSources
396                for source in sources:
397                    result = yield self.startUpload(source, masterdest)
398                    if result == FAILURE:
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/twisted/internet/defer.py:654 in _runCallbacks
653                    try:
654                        current.result = callback(current.result, *args, **kw)
655                        if current.result is current:
/data1/buildbot/install-2.x/sandbox/lib/python3.7/site-packages/buildbot/steps/transfer.py:342 in checkStat
341        def checkStat(_):
342            s = cmd.updates['stat'][-1]
343            if stat.S_ISDIR(s[stat.ST_MODE]):
builtins.KeyError: 'stat'

in the worker implementation:

       try:
            stat = os.stat(filename)
            self.sendStatus({'stat': tuple(stat)})
            self.sendStatus({'rc': 0})
        except OSError as e:
            log.msg("StatFile {0} failed: {1}".format(filename, e))
            self.sendStatus(
                {'header': '{0}: {1}: {2}'.format(self.header, e.strerror, filename)})
            self.sendStatus({'rc': e.errno})

when os.stat fail, no 'stat' status is send, but the master will anyway check for 'stat' first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants