Skip to content

Conversation

@adithyaappu
Copy link

@adithyaappu adithyaappu commented Jan 6, 2026

Please provide enough information so that others can review your pull request:

This pull request addresses the error

pymysql.err.OperationalError: (1130, "Host '172.18.0.6' is not allowed to connect to this MariaDB server")

Which started showing up after updating Docker Desktop in Windows.

MariaDB Error Trace
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/workspace/kbmr-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/workspace/kbmr-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/apps/frappe/frappe/commands/site.py", line 105, in new_site
    _new_site(
  File "/workspace/kbmr-bench/apps/frappe/frappe/installer.py", line 90, in _new_site
    install_db(
  File "/workspace/kbmr-bench/apps/frappe/frappe/installer.py", line 170, in install_db
    setup_database(force, verbose, mariadb_user_host_login_scope)
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/__init__.py", line 21, in setup_database
    return frappe.database.mariadb.setup_db.setup_database(force, verbose, mariadb_user_host_login_scope)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 33, in setup_database
    dbman.delete_user(db_name, **dbman_kwargs)
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/db_manager.py", line 23, in delete_user
    self.db.sql(f"DROP USER IF EXISTS '{target}'@'{host}'")
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/database.py", line 207, in sql
    self.connect()
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/database.py", line 112, in connect
    self._conn: MariadbConnection | PostgresConnection = self.get_connection()
                                                         ^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/mariadb/database.py", line 108, in get_connection
    conn = self._get_connection()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/mariadb/database.py", line 114, in _get_connection
    return self.create_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/apps/frappe/frappe/database/mariadb/database.py", line 117, in create_connection
    return pymysql.connect(**self.get_connection_settings())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 361, in __init__
    self.connect()
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 668, in connect
    self._get_server_information()
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 1098, in _get_server_information
    packet = self._read_packet()
             ^^^^^^^^^^^^^^^^^^^
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/workspace/kbmr-bench/env/lib/python3.11/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1130, "Host '172.18.0.6' is not allowed to connect to this MariaDB server")

Explain the details for making this change. What existing problem does the pull request solve?

After updating the Docker Desktop for Windows to v4.55.0 MariaDB had an issue related to permission denied for connections from other containers. This commit resolves it by adding a dedicated network for all the containers in the compose, and adding a flag of MariaDB to avoid DNS resolution.

P.S: This may need more tests for users from other operating systems. But dedicated network is very much unlikely to cause any issues in the existing setup. Probably only an issue for users using Cypress for UI Tests

@DanielRadlAMR
Copy link
Collaborator

I did not encounter any error with Docker Desktop v4.55.0 on Windows with an Ubuntu WSL.

I did use the install.py script to set up the bench and site, which sets --mariadb-user-host-login-scope=%.

I did not use Cypress so far.

@adithyaappu
Copy link
Author

adithyaappu commented Jan 8, 2026

I did not encounter any error with Docker Desktop v4.55.0 on Windows with an Ubuntu WSL.

I did use the install.py script to set up the bench and site, which sets --mariadb-user-host-login-scope=%.

I did not use Cypress so far.

We did more tests, and it looks like the issue pops up only in very fresh setup. So we did

  1. Deleted the Frappe and MariaDB containers
  2. Deleted the MariaDB volume
  3. Deleted the of MariaDB image
  4. Cleared builder cache (system prune)
  5. Create a new bench
  6. Init new site

At this point we were able to get this issue in another system also. One of my team member faced this issue first, then I tried replicating it in my system. With a fresh install I managed to replicate it.

Is it possible for you to test out in a fresh setup?

My config:

  • OS: Windows 11 on WSL 2 Debian
  • MariaDB: 11.8
  • Frappe: v15.94.0
  • Bench: v5.28.0

@DanielRadlAMR
Copy link
Collaborator

Thanks for the follow-up!

Unfortunately, my time is quite tight at the moment, so I can’t invest the time needed to test this right now.

That said, I do use devcontainers regularly, and if I run into any issues, I’ll keep this in mind. For now, however, I won’t be able to set up a fresh environment to test the issue.

After updating the Docker Desktop for Windows to v4.55.0 MariaDB had an
issue related to permission denied for connections from other
containers. This commit resolves it by adding a dedicated network for
all the containers in the compose, and adding a flag of MariaDB to avoid
DNS resolution.
@adithyaappu adithyaappu force-pushed the docker-desktop-windows-fix branch from 980c2f9 to 731efdb Compare January 21, 2026 11:05
@DanielRadlAMR
Copy link
Collaborator

FYI, I recently set up a fresh dev environment with bench v5.27.0 and didn’t run into any issues.

I haven’t switched my dev setup to v16 yet, and I’m not entirely sure when I’ll be able to since it needs some preparation. I can check this again with the latest bench version after I’ve switched.

@adithyaappu
Copy link
Author

That is so weird. I wonder if it is specific to newer version of bench >=5.28.0 and Frappe version ~15. Probably in the upcoming weeks I may get more time to test it thoroughly. Let us see if anyone else faces the issue in the mean time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants