Skip to content

BUG: Whois expiring date in 2103, MariaDB (y2k38_limit) #388

Description

@spirillen

Description

Log (screen output)

kinhdoanhcontainer.com                                                                               ACTIVE      WHOIS
Process pyfunceble_producer_worker_1:
Traceback (most recent call last):
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.DataError: (1264, "Out of range value for column 'epoch' at row 1")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/sql_base.py", line 302, in add
    self.db_session.execute(self.ORM_OBJ.__table__.insert(), row)
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2362, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2256, in _execute_internal
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/home/spirillen/.local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/home/spirillen/.local/lib/python3.11/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1264, "Out of range value for column 'epoch' at row 1")
[SQL: INSERT INTO pyfunceble_whois_record (subject, idna_subject, expiration_date, epoch, registrar, created_at, modified_at) VALUES (%(subject)s, %(idna_subject)s, %(expiration_date)s, %(epoch)s, %(registrar)s, %(created_at)s, %(modified_at)s)]
[parameters: {'subject': 'kingwilliamcounty.us', 'idna_subject': 'kingwilliamcounty.us', 'expiration_date': '13-jan-2102', 'epoch': 4166550000.0, 'registrar': '.us Reserve Account A', 'created_at': datetime.datetime(2024, 9, 30, 12, 14, 14, 599988), 'modified_at': datetime.datetime(2024, 9, 30, 12, 14, 14, 599995)}]
(Background on this error at: https://sqlalche.me/e/20/9h9h)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/cli/processes/workers/base.py", line 406, in run
    raise exception
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/cli/processes/workers/base.py", line 378, in run
    result = self.target(consumed)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/cli/processes/workers/producer.py", line 419, in target
    self.run_whois_backup(test_result)
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/cli/processes/workers/producer.py", line 218, in run_whois_backup
    self.whois_dataset.update(
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/db_base.py", line 104, in wrapper
    return func(self, *args, **kwargs)  # pylint: disable=not-callable
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/whois/sql.py", line 149, in update
    super().update(row, ignore_if_exist=ignore_if_exist)
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/db_base.py", line 104, in wrapper
    return func(self, *args, **kwargs)  # pylint: disable=not-callable
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/sql_base.py", line 162, in update
    self.add(row)
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/db_base.py", line 104, in wrapper
    return func(self, *args, **kwargs)  # pylint: disable=not-callable
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/sql_base.py", line 108, in wrapper
    return func(self, *args, **kwargs)  # pylint: disable=not-callable
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spirillen/.local/lib/python3.11/site-packages/PyFunceble/dataset/sql_base.py", line 310, in add
    new_date -= new_date - y2k38_limit
                ~~~~~~~~~^~~~~~~~~~~~~
TypeError: can't subtract offset-naive and offset-aware datetimes

Configuration

Not relevant

Reproduction

  1. Use mariaDB
  2. pyfunceble -c --preload --no-files -f https://bitbucket.org/expiredsources/hosts-file.net/raw/master/psh.txt

Expected behavior

I wonder...

Screenshots

Sure, but already copied relevant output ⏫

Versions

OS: Debian 12 Bookworm

Python Version: 3.11

PyFunceble Version: 4.2.29.dev (Blue Duckling: Tulip)

Additional context

It's a lovely day, slightly cloudy and not to warm. 🌥️

Metadata

Metadata

Assignees

Labels

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions