error.log 9.35 KB
14:00:52 ERROR [X] DWS Sync failed for task_id=manual_dws_sync: (1054, "Unknown column 'report_date' in 'where clause'")  [etl_service.py:326]
Traceback (most recent call last):
  File "D:\work1\data-analyze-webui\app\services\etl_service.py", line 291, in run_dw_sync
    cur.execute(f"DELETE FROM `{table_name}` WHERE report_date BETWEEN %s AND %s", (start_date, end_date))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 157, in execute
    result = self._query(query)
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 328, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 575, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 826, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 1203, in read
    first_packet = self.connection._read_packet()
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 782, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'report_date' in 'where clause'")
14:07:54 ERROR [X] ODS Sync failed for task_id=manual_ods_sync: (1048, "Column 'merchant_id' cannot be null")  [etl_service.py:220]
Traceback (most recent call last):
  File "D:\work1\data-analyze-webui\app\services\etl_service.py", line 177, in run_ods_sync
    cur.executemany(upsert_sql, data_tuples)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 186, in executemany
    return self._do_execute_many(
           ~~~~~~~~~~~~~~~~~~~~~^
        q_prefix,
        ^^^^^^^^^
    ...<4 lines>...
        self._get_db().encoding,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 219, in _do_execute_many
    rows += self.execute(sql + postfix)
            ~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 157, in execute
    result = self._query(query)
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 328, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 575, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 826, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 1203, in read
    first_packet = self.connection._read_packet()
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 782, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1048, "Column 'merchant_id' cannot be null")
14:49:20 ERROR Failed to call LLM for schema analysis:   [llm_service.py:90]
14:50:21 ERROR Failed to call LLM for schema analysis:   [llm_service.py:90]
14:50:21 ERROR Failed to process dynamic upload: Object of type datetime is not JSON serializable  [excel_service.py:105]
Traceback (most recent call last):
  File "D:\work1\data-analyze-webui\app\services\excel_service.py", line 73, in process_dynamic_upload
    schema = await LLMService.analyze_excel_schema(sheet, headers_raw, sample_data_raw, upload_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\work1\data-analyze-webui\app\services\llm_service.py", line 31, in analyze_excel_schema
    原始表头 (可能包含多行): {json.dumps(headers, ensure_ascii=False)}
                              ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\json\__init__.py", line 242, in dumps
    **kw).encode(obj)
          ~~~~~~^^^^^
  File "D:\Python313\Lib\json\encoder.py", line 202, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "D:\Python313\Lib\json\encoder.py", line 263, in iterencode
    return _iterencode(o, 0)
  File "D:\Python313\Lib\json\encoder.py", line 182, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
                    f'is not JSON serializable')
TypeError: Object of type datetime is not JSON serializable
16:58:33 ERROR Failed to query store info from DB: (1146, "Table 'data_analyze.dj_car_life_scene_merchant_ref' doesn't exist")  [analysis_service.py:421]
Traceback (most recent call last):
  File "D:\work1\data-analyze-webui\app\services\analysis_service.py", line 399, in _query_store_info
    cur.execute(sql, (*store_names,))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 157, in execute
    result = self._query(query)
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 328, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 575, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 826, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 1203, in read
    first_packet = self.connection._read_packet()
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 782, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'data_analyze.dj_car_life_scene_merchant_ref' doesn't exist")
16:58:35 ERROR Analysis generate failed: name 'touch' is not defined  [endpoints.py:272]
Traceback (most recent call last):
  File "D:\work1\data-analyze-webui\app\api\endpoints.py", line 256, in analysis_generate
    output_path = AnalysisService.build_report(
        store_df, factory_sheets,
        start_date=start_date or None,
        end_date=end_date or None
    )
  File "D:\work1\data-analyze-webui\app\services\analysis_service.py", line 493, in build_report
    AnalysisService._write_data_rows(ws, store_df, factory_sheets, db_perf,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                      start_date, end_date)
                                      ^^^^^^^^^^^^^^^^^^^^^
  File "D:\work1\data-analyze-webui\app\services\analysis_service.py", line 652, in _write_data_rows
    touch_safe = _safe_float(touch, 0)
                             ^^^^^
NameError: name 'touch' is not defined
18:16:26 ERROR Failed to query store performance from DB: (1054, "Unknown column 'sence_type' in 'where clause'")  [analysis_service.py:354]
Traceback (most recent call last):
  File "D:\work1\data-analyze-webui\app\services\analysis_service.py", line 321, in _query_store_performance
    cur.execute(sql, params)
    ~~~~~~~~~~~^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 157, in execute
    result = self._query(query)
  File "D:\Python313\Lib\site-packages\pymysql\cursors.py", line 328, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 575, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 826, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 1203, in read
    first_packet = self.connection._read_packet()
  File "D:\Python313\Lib\site-packages\pymysql\connections.py", line 782, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python313\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "D:\Python313\Lib\site-packages\pymysql\err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'sence_type' in 'where clause'")