diff --git a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py index f91f71a..e3b7cb1 100644 --- a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/tomo_queue_mixin.py @@ -421,6 +421,20 @@ class TomoQueueMixin: """ def _run(): + # tomo_id_manager.FALLBACK_TOMO_ID (0) means add_sample_database() + # never actually registered anything server-side (no valid + # e-account) -- there's no real "new.pdf" slot reserved for this + # session, so uploading would just claim whatever number + # countersaver.txt currently happens to hold, i.e. some unrelated + # real measurement's slot. Skip rather than risk clobbering it. + if self.tomo_id == self.tomo_id_manager.FALLBACK_TOMO_ID: + print( + f"Skipping PDF upload: tomo_id={self.tomo_id} means no real " + "measurement was registered (not a valid e-account) -- " + "there's no samples-folder slot to upload into." + ) + return + try: import base64 @@ -451,13 +465,13 @@ class TomoQueueMixin: allow_redirects=False, # SSRF hardening ) if r.status_code != 200: - print(f"PDF upload to {url} -> HTTP {r.status_code}: {r.text[:120]}") + print(f"PDF upload to {url} -> HTTP {r.status_code}: {r.text[:400]}") continue if expected_name not in r.text: print( f"PDF upload to {url} succeeded but the server-assigned " f"filename doesn't match tomo_id {self.tomo_id} (response: " - f"{r.text[:120]!r}) -- a concurrent measurement " + f"{r.text[:400]!r}) -- a concurrent measurement " "registration may have raced this upload." ) else: