Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RC1 autoconf startup error #1894

Closed
2 tasks done
Divaaaaaan opened this issue Jan 10, 2025 · 3 comments
Closed
2 tasks done

[BUG] RC1 autoconf startup error #1894

Divaaaaaan opened this issue Jan 10, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Divaaaaaan
Copy link

What happened?

Auto conf container not starting due to error

How to reproduce?

New docker compose template with 1.6.0-rc1.

Configuration file(s) (yaml or .env)

x-ui-env: &ui-env
  # We anchor the environment variables to avoid duplication
  AUTOCONF_MODE: "yes"
  DATABASE_URI: "mariadb+pymysql://bunkerweb:changeme@bw-db:3306/db" # Remember to set a stronger password for the database

services:
  bunkerweb:
    image: bunkerity/bunkerweb:1.6.0-rc1
    ports:
      - "80:8080/tcp"
      - "443:8443/tcp"
      - "443:8443/udp" # For QUIC / HTTP3 support
    labels:
      - "bunkerweb.INSTANCE=yes" # We set the instance label to allow the autoconf to detect the instance
    environment:
      AUTOCONF_MODE: "yes"
      API_WHITELIST_IP: "127.0.0.0/8 10.0.0.0/8"
    networks:
      - bw-universe
      - bw-services

  bw-scheduler:
    image: bunkerity/bunkerweb-scheduler:1.6.0-rc1
    environment:
      <<: *ui-env
      BUNKERWEB_INSTANCES: ""
      SERVER_NAME: ""
      API_WHITELIST_IP: "127.0.0.0/8 10.0.0.0/8"
      MULTISITE: "yes"
    volumes:
      - /mnt/data/applications/bnkr-wb/data:/data # This is used to persist the cache and other data like the backups
    networks:
      - bw-universe
      - bw-db

  bw-autoconf:
    image: bunkerity/bunkerweb-autoconf:1.6.0-rc1
    depends_on:
      - bw-docker
    environment:
      <<: *ui-env
      DOCKER_HOST: "tcp://bw-docker:2375"
    networks:
      - bw-universe
      - bw-docker
      - bw-db

  bw-docker:
    image: tecnativa/docker-socket-proxy:nightly
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      CONTAINERS: "1"
      LOG_LEVEL: "warning"
    networks:
      - bw-docker

  bw-db:
    image: mariadb:11
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
      MYSQL_DATABASE: "db"
      MYSQL_USER: "bunkerweb"
      MYSQL_PASSWORD: "changeme" # Remember to set a stronger password for the database
    volumes:
      - /mnt/data/applications/bnkr-wb/mysql:/var/lib/mysql
    networks:
      - bw-db

  bw-ui:
    image: bunkerity/bunkerweb-ui:1.6.0-rc1
    environment:
      <<: *ui-env
      ADMIN_USERNAME: "admin"
      ADMIN_PASSWORD: "Adminpassword01!" # Remember to set a stronger password for the changeme user
      TOTP_SECRETS: "mysecret" # Remember to set a stronger secret key (see the Prerequisites section)
    labels:
      - "bunkerweb.SERVER_NAME=bnkr-wb.exmlpe.com"
      - "bunkerweb.USE_UI=yes"
      - "bunkerweb.USE_REVERSE_PROXY=yes"
      - "bunkerweb.REVERSE_PROXY_URL=/"
      - "bunkerweb.REVERSE_PROXY_HOST=http://bw-ui:7000"
      - "bunkerweb.INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504"
      - "bunkerweb.GENERATE_SELF_SIGNED_SSL=yes"
      - "bunkerweb.MAX_CLIENT_SIZE=50m"
      - "bunkerweb.ALLOWED_METHODS=GET|POST|PUT|DELETE"
    networks:
      # testvlan:
      #   ipv4_address: 10.69.3.43
      bw-universe:
      bw-db:

networks:
  # testvlan:
  #   external: true
  bw-universe:
    name: bw-universe
    ipam:
      driver: default
      config:
        - subnet: 10.20.30.0/24
  bw-services:
    name: bw-services
  bw-docker:
    name: bw-docker
  bw-db:
    name: bw-db

Relevant log output

[2025-01-10 18:07:41 +0000] [AUTOCONF] [1] [ℹ️ ] - Docker mode detected

[2025-01-10 18:07:41 +0000] [CONFIG] [1] [ℹ️ ] - ✅ Database connection established

[2025-01-10 18:07:41 +0000] [AUTOCONF] [1] [ℹ️ ] - Waiting for BunkerWeb instances ...

[2025-01-10 18:07:41 +0000] [AUTOCONF] [1] [ℹ️ ] - BunkerWeb instances are ready 🚀

[2025-01-10 18:07:41 +0000] [AUTOCONF] [1] [ℹ️ ] - Instance #1 : bnkr-wb-bunkerweb-1

/usr/share/bunkerweb/db/Database.py:317: SAWarning: transaction already deassociated from connection

  session.rollback()

[2025-01-10 18:07:42 +0000] [AUTOCONF] [1] [❌] - Exception while running autoconf :

Traceback (most recent call last):

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1964, in _exec_single_context

    self.dialect.do_execute(

    ~~~~~~~~~~~~~~~~~~~~~~~^

        cursor, str_statement, effective_parameters, context

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 942, in do_execute

    cursor.execute(statement, parameters)

    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute

    result = self._query(query)

  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query

    conn.query(q)

    ~~~~~~~~~~^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query

    self._affected_rows = self._read_query_result(unbuffered=unbuffered)

                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result

    result.read()

    ~~~~~~~~~~~^^

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read

    first_packet = self.connection._read_packet()

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet

    packet.raise_for_error()

    ~~~~~~~~~~~~~~~~~~~~~~^^

  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error

    err.raise_mysql_exception(self._data)

    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception

    raise errorclass(errno, errval)

pymysql.err.OperationalError: (1054, "Unknown column 'bw_template_settings.order' in 'ORDER BY'")

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

Traceback (most recent call last):

  File "/usr/share/bunkerweb/autoconf/main.py", line 64, in <module>

    if not controller.apply_config():

           ~~~~~~~~~~~~~~~~~~~~~~~^^

  File "/usr/share/bunkerweb/autoconf/DockerController.py", line 135, in apply_config

    return self.apply(self._instances, self._services, configs=self._configs, first=not self._loaded)

           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/share/bunkerweb/autoconf/Config.py", line 166, in apply

    err = self._db.save_config(self.__config, "autoconf", changed=False)

  File "/usr/share/bunkerweb/db/Database.py", line 1340, in save_config

    session.query(Template_settings)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    .with_entities(Template_settings.template_id, Template_settings.setting_id, Template_settings.suffix, Template_settings.default)

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    .order_by(Template_settings.order)

    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2839, in __iter__

    result = self._iter()

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2853, in _iter

    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(

                                                  ~~~~~~~~~~~~~~~~~~~~^

        statement,

        ^^^^^^^^^^

        params,

        ^^^^^^^

        execution_options={"_sa_orm_load_options": self.load_options},

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2365, in execute

    return self._execute_internal(

           ~~~~~~~~~~~~~~~~~~~~~~^

        statement,

        ^^^^^^^^^^

    ...<4 lines>...

        _add_event=_add_event,

        ^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2251, in _execute_internal

    result: Result[Any] = compile_state_cls.orm_execute_statement(

                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

        self,

        ^^^^^

    ...<4 lines>...

        conn,

        ^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement

    result = conn.execute(

        statement, params or {}, execution_options=execution_options

    )

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1416, in execute

    return meth(

        self,

        distilled_parameters,

        execution_options or NO_OPTIONS,

    )

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection

    return connection._execute_clauseelement(

           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

        self, distilled_params, execution_options

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement

    ret = self._execute_context(

        dialect,

    ...<8 lines>...

        cache_hit=cache_hit,

    )

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1843, in _execute_context

    return self._exec_single_context(

           ~~~~~~~~~~~~~~~~~~~~~~~~~^

        dialect, context, statement, parameters

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1983, in _exec_single_context

    self._handle_dbapi_exception(

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

        e, str_statement, effective_parameters, cursor, context

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2352, in _handle_dbapi_exception

    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1964, in _exec_single_context

    self.dialect.do_execute(

    ~~~~~~~~~~~~~~~~~~~~~~~^

        cursor, str_statement, effective_parameters, context

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    )

    ^

  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 942, in do_execute

    cursor.execute(statement, parameters)

    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute

    result = self._query(query)

  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query

    conn.query(q)

    ~~~~~~~~~~^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query

    self._affected_rows = self._read_query_result(unbuffered=unbuffered)

                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result

    result.read()

    ~~~~~~~~~~~^^

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read

    first_packet = self.connection._read_packet()

  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet

    packet.raise_for_error()

    ~~~~~~~~~~~~~~~~~~~~~~^^

  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error

    err.raise_mysql_exception(self._data)

    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^

  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception

    raise errorclass(errno, errval)

sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1054, "Unknown column 'bw_template_settings.order' in 'ORDER BY'")

[SQL: SELECT bw_template_settings.template_id AS bw_template_settings_template_id, bw_template_settings.setting_id AS bw_template_settings_setting_id, bw_template_settings.suffix AS bw_template_settings_suffix, bw_template_settings.`default` AS bw_template_settings_default 

FROM bw_template_settings ORDER BY bw_template_settings.`order`]

(Background on this error at: https://sqlalche.me/e/20/e3q8)

BunkerWeb version

1.6.0-rc1

What integration are you using?

Docker

Linux distribution (if applicable)

Truenas

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Divaaaaaan Divaaaaaan added the bug Something isn't working label Jan 10, 2025
@TheophileDiot
Copy link
Member

Hi @Divaaaaaan, thank you for opening this issue. Did you down all containers and then up them afterwards ?

@TheophileDiot TheophileDiot self-assigned this Jan 13, 2025
@TheophileDiot
Copy link
Member

Feel free to join our discord to discuss this easily: https://discord.bunkerity.com

@Divaaaaaan
Copy link
Author

Thanks @TheophileDiot, I've joined Discord but this has since been resolved so will close thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants