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

Problem deploy nexterp on docker inside nas enviroment (synology) #1540

Closed
FulanoD3Tal opened this issue Jan 6, 2025 · 3 comments
Closed
Labels

Comments

@FulanoD3Tal
Copy link
Contributor

Using the pwd.yml file on root folder with the only change been the port of the frontend

....

  frontend:
    image: frappe/erpnext:v15.47.5
    networks:
      - frappe_network
    depends_on:
      - websocket
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - nginx-entrypoint.sh
    environment:
      BACKEND: backend:8000
      FRAPPE_SITE_NAME_HEADER: frontend
      SOCKETIO: websocket:9000
      UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
      UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
      UPSTREAM_REAL_IP_RECURSIVE: "off"
      PROXY_READ_TIMEOUT: 120
      CLIENT_MAX_BODY_SIZE: 50m
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs
    ports:
      - "9080:8080" # Only change

....

The docker compose up command correctly but when deploy is done i only get this page

image

the problem when the deploy are made and the user for the mariadb container is not configurated correctly, i have try deploying this is linux and windows docker container successfully so is not problem of the docker compose file itself

someone has found the fix for this problem ? i will like to run this in my server, any help is welcome

Here is the error trace of nexterp-db-1 container

nexterp-db-1 |   |  
-- | -- | --
date | stream | content
2025/01/06 12:39:45 | stderr | 2025-01-06 18:39:45 215 [Warning] Access denied for user '_5e5899d8398b5f7b'@'172.25.0.4' (using password: YES)
  |   |  
2025/01/06 12:38:45 | stderr | 2025-01-06 18:38:45 172 [Warning] Access denied for user '_5e5899d8398b5f7b'@'172.25.0.4' (using password: YES)
  |   |  
2025/01/06 12:37:45 | stderr | 2025-01-06 18:37:45 128 [Warning] Access denied for user '_5e5899d8398b5f7b'@'172.25.0.4' (using password: YES)
  |   |  
2025/01/06 12:36:45 | stderr | 2025-01-06 18:36:45 83 [Warning] Access denied for user '_5e5899d8398b5f7b'@'172.25.0.4' (using password: YES)
  |   |  
2025/01/06 12:35:45 | stderr | 2025-01-06 18:35:45 38 [Warning] Access denied for user '_5e5899d8398b5f7b'@'172.25.0.4' (using password: YES)
  |   |  
2025/01/06 12:34:54 | stderr | Version: '10.6.20-MariaDB-ubu2004'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
  |   |  
2025/01/06 12:34:54 | stderr | 2025-01-06 18:34:54 0 [Note] mariadbd: ready for connections.
  |   |  
2025/01/06 12:34:53 | stderr | 2025-01-06 18:34:53 0 [Note] Server socket created on IP: '::'.
  |   |  
2025/01/06 12:34:53 | stderr | 2025-01-06 18:34:53 0 [Note] Server socket created on IP: '0.0.0.0'.

and the nexterp-backend-1 container error trace

nexterp-backend-1 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
-- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | --
date | stream | content |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr | "pymysql.err.OperationalError: | (2003 |   | \"Can't | connect | to | MySQL | server | on | 'db' | ([Errno | 111] | Connection | refused)\")
2025/01/06 12:34:25,stderr,    raise exc2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py\" |   | line | 716 |   | in | connect |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,    self.connect()2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py\" |   | line | 361 |   | in | __init__ |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    return pymysql.connect(**self.get_connection_settings())2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py\" |   | line | 116 |   | in | create_connection |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,           ^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    return self.create_connection()2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py\" |   | line | 113 |   | in | _get_connection |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,           ^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    conn = self._get_connection()2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py\" |   | line | 107 |   | in | get_connection |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,                                                             ^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    self._conn: "MariadbConnection | \| | PostgresConnection | = | self.get_connection() |   |   |   |   |   |   |   |   |   |   |   |  
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr | File \"/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py\ |   | line | 112 |   | in | connect |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,    self.connect()2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py\" |   | line | 207 |   | in | sql |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | result | = | frappe.db.sql(query |   | params |   | *args |   | **kwargs) |   | # | nosemgrep |  
2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/query_builder/utils.py\" |   | line | 87 |   | in | execute_query |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | return | query.run(as_dict=as_dict |   | debug=debug |   | update=update |   | run=run |   | pluck=pluck) |   |   |  
2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py\" |   | line | 892 |   | in | _get_values_from_table |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    out = self._get_values_from_table(2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py\" |   | line | 619 |   | in | get_values |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,             ^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    result = self.get_values(2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py\" |   | line | 515 |   | in | get_value |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | doctype_info | = | frappe.db.get_value(\"DocType\" |   | doctype |   | fieldname=\"*\") |   |   |   |   |   |  
2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py\" |   | line | 82 |   | in | import_controller |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,                                ^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    site_controllers[doctype] = import_controller(doctype)2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py\" |   | line | 71 |   | in | get_controller |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,                 ^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    controller = get_controller(doctype)2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\" |   | line | 83 |   | in | get_doc |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | doc | = | frappe.model.document.get_doc(*args |   | **kwargs) |   |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\" |   | line | 1291 |   | in | get_doc |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,          ^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | doc | = | get_doc(*args |   | **kwargs) |   |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\" |   | line | 1165 |   | in | get_cached_doc |   |   |   |   |   |   |  
" |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr |   |   |   |   |   |   |   |   |   |   |   |   |   |  
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr |   |   |   |   | local.system_settings | = | get_cached_doc("System | Settings") |   |   |   |   |   |  
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr | File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\ |   | line | 2350 |   | in | get_system_settings |   |   |   |   |   |   |  
" |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr |   |   |   |   |   |   |   |   |   |   |   |   |   |  
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr |   |   |   |   | allow_traceback | = | frappe.get_system_settings("allow_error_traceback") | if | frappe.db | else | False |   |   |  
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  
2025/01/06 | 12:34:25 | stderr | File \"/home/frappe/frappe-bench/apps/frappe/frappe/app.py\ |   | line | 323 |   | in | handle_exception |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,               ^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr,    response = handle_exception(e)2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/apps/frappe/frappe/app.py\" |   | line | 132 |   | in | application |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,           ^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | resp | = | f(*args[:-2] | + | (request | )) |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr, |   | File | \"/home/frappe/frappe-bench/env/lib/python3.11/site-packages/werkzeug/wrappers/request.py\" |   | line | 190 |   | in | application |   |   |   |   |   |   |  
2025/01/06 12:34:25,stderr,    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^2025/01/06 12:34:25,stderr, |   |   |   | app(environ |   | start_response) |   |   |   |   |   |   |   |   |   |  

@revant
Copy link
Collaborator

revant commented Jan 7, 2025

2025/01/06 | 12:34:25 | stderr | "pymysql.err.OperationalError: | (2003 |   | "Can't | connect | to | MySQL | server | on | 'db' | ([Errno | 111] | Connection | refused)")

Make sure the containers can connect to "db" service/container.

@FulanoD3Tal
Copy link
Contributor Author

The connection between the container was correct actually the errors came from the backend container try to connect to the db container

i follow the troubleshoot.md documentation inside the repo and run these commands and restart the whole docker container fix the problem for me, the only difference is that i have to create the user, not update it, as i said is look to be a problem , probably realted to user permissions when creating the user for nexterp inside the mariadb container

CREATE USER 'db_name'@'%' IDENTIFIED BY 'your_password';
-- UPDATE mysql.global_priv SET Host = '%' where User = 'db_name'; FLUSH PRIVILEGES;
SET PASSWORD FOR 'db_name'@'%' = PASSWORD('db_password'); FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON `db_name`.* TO 'db_name'@'%' IDENTIFIED BY 'db_password' WITH GRANT OPTION; FLUSH PRIVILEGES;
EXIT;

maybe an update of the documentation can be useful

@FulanoD3Tal
Copy link
Contributor Author

Just create the PR #1542 for improve the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants