sstate: fix up additional debugging when fetch fails occur

Message ID 20220208203749.275175-1-alex@linutronix.de
State Accepted, archived
Commit 9fbc7d6a2b2388e70a76cb97285e2f60bdc79624
Headers show
Series sstate: fix up additional debugging when fetch fails occur | expand

Commit Message

Alexander Kanavin Feb. 8, 2022, 8:37 p.m. UTC
This should print the actual stack trace, for real :)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes/sstate.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 475ce40c6b..54edf0bec6 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -992,6 +992,8 @@  def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
             localdata.setVar('SRC_URI', srcuri)
             bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
+            import traceback
+
             try:
                 fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2,
                             connection_cache=thread_worker.connection_cache)
@@ -1000,9 +1002,9 @@  def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 found.add(tid)
                 missed.remove(tid)
             except bb.fetch2.FetchError as e:
-                bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)\n%s" % (srcuri, repr(e), e.__traceback__))
+                bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)\n%s" % (srcuri, repr(e), traceback.format_exc()))
             except Exception as e:
-                bb.error("SState: cannot test %s: %s\n%s" % (srcuri, repr(e), e.__traceback__))
+                bb.error("SState: cannot test %s: %s\n%s" % (srcuri, repr(e), traceback.format_exc()))
 
             if progress:
                 bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d)