LCOGT / banzai

Beautiful Algorithms to Normalize Zillions of Astronomical Images
GNU General Public License v3.0
29 stars 18 forks source link

logging.warning does not appear to be working #393

Open cmccully opened 2 months ago

cmccully commented 2 months ago

Screenshot 2024-08-16 at 9 51 02 AM It appears warnings.warn warnings are showing up correctly. Checking the highlighted frame in my tests showed that WCSERR=4 so https://github.com/LCOGT/banzai/blob/main/banzai/photometry.py#L300 should have printed a log message but it does not exist.

cmccully commented 2 months ago

Noticed this error during logging. Might be related: 2024-08-16 14:06:55.183 WARNING: log: --- Logging error --- 2024-08-16 14:06:55.686 WARNING: log: Traceback (most recent call last): 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/logging/init.py", line 1100, in emit msg = self.format(record) 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/logging/init.py", line 943, in format return fmt.format(record) 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/lcogt_logging/lcogt_formatter.py", line 45, in format json.dumps(tags) 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/json/init.py", line 231, in dumps return _default_encoder.encode(obj) 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) 2024-08-16 14:06:55.687 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' 2024-08-16 14:06:55.687 WARNING: log: TypeError: Object of type datetime is not JSON serializable 2024-08-16 14:06:55.687 WARNING: log: Call stack: 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/bin/celery", line 8, in sys.exit(main()) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/main.py", line 15, in main sys.exit(_main()) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/bin/celery.py", line 236, in main return celery(auto_envvar_prefix="CELERY") 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, *kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/bin/base.py", line 135, in caller return f(ctx, args, kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/bin/worker.py", line 356, in worker worker.start() 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/worker/worker.py", line 202, in start self.blueprint.start(self) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/bootsteps.py", line 116, in start step.start(parent) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/bootsteps.py", line 365, in start return self.obj.start() 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/concurrency/base.py", line 130, in start self.on_start() 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/concurrency/prefork.py", line 109, in on_start P = self._pool = Pool(processes=self.limit, 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/concurrency/asynpool.py", line 464, in init super().init(processes, *args, kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/pool.py", line 1045, in init self._create_worker_process(i) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/concurrency/asynpool.py", line 482, in _create_worker_process return super()._create_worker_process(i) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/pool.py", line 1157, in _create_worker_process w.start() 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/process.py", line 120, in start self._popen = self._Popen(self) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/context.py", line 331, in _Popen return Popen(process_obj) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/popen_fork.py", line 22, in init self._launch(process_obj) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/popen_fork.py", line 77, in _launch code = process_obj._bootstrap() 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/process.py", line 323, in _bootstrap self.run() 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/process.py", line 110, in run self._target(*self._args, *self._kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/pool.py", line 291, in call sys.exit(self.workloop(pid=pid)) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/billiard/pool.py", line 361, in workloop result = (True, prepare_result(fun(args, kwargs))) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/app/trace.py", line 651, in fast_trace_task R, I, T, Rstr = tasks[task].trace( 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/app/trace.py", line 453, in trace_task R = retval = fun(*args, *kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/celery/app/trace.py", line 736, in __protected_call__ return self.run(args, **kwargs) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/banzai/celery.py", line 166, in stack_calibrations calibrations.make_master_calibrations(instrument, frame_type, min_date, max_date, runtime_context) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/banzai/calibrations.py", line 193, in make_master_calibrations stage_utils.run_pipeline_stages(calibration_frames_info, runtime_context, calibration_maker=True) 2024-08-16 14:06:55.689 WARNING: log: File "/home/archive/envs/banzai/lib/python3.10/site-packages/banzai/utils/stage_utils.py", line 60, in run_pipeline_stages logger.error('Reduction stopped', extra_tags={'filename': image_paths}) 2024-08-16 14:06:55.689 WARNING: log: Message: 'Reduction stopped' Arguments: () 2024-08-16 14:06:55.689 INFO: calibrations: Finished | {"processName": "ForkPoolWorker-1"} 2024-08-16 14:06:55.689 INFO: trace: Task celery.stack_calibrations[c8ea36d7-c105-46b8-ab0b-c7f3a51cca09] succeeded in 14.61367720097769s: None