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

RQ Logs frappe.exceptions.IncorrectSitePath: 404 Not Found: <sitename> does not exist #1437

Closed
letajmal opened this issue Jul 16, 2024 · 1 comment

Comments

@letajmal
Copy link

letajmal commented Jul 16, 2024

Description of the issue

Docker Compose Single Server Multi Bench Setup has issues

Context information (for bug reports)

Service names are the same when following the default instructions in Single Server Example

Multiple projects share a MariaDB service using the same network (mariadb-network) and have the same service names.

For eg: I have ProjectA and ProjectB and I am sharing mariadb-network with both of these projects. Service names are same in both projects, its like running 2 instance of containers which are a part of mariadb-network.

In my case, ProjectA's worker was pulling jobs from ProjectB's redis queue.

From the Docker Docs AI,

If you have two Docker Compose projects with the same service names but different networks, there should not be any conflict because the DNS resolution is network-scoped. This means that a service web in network1 is not the same as a service web in network2, even if they have the same service name. They can coexist without any issues because they are in different networks.
However, if the services are also attached to a shared network, the situation can be different. If a service tries to resolve a hostname, and the hostname is present in both the project-specific network and the shared network, Docker does not guarantee which one it will resolve to. This is because a network-wide alias can be shared by multiple containers, and even by multiple services. If it is, then exactly which container the name resolves to is not guaranteed [source].

You can fix this by giving each service a unique name or hostname, or by using separate MariaDB instances for each Docker Compose project.

Using separate MariaDB instances means you don't need to share the mariadb-network. However, the best solution is to give unique service names, hostnames, or aliases in each project.

Steps to reproduce the issue

  1. Create mutiple benches by following the Single Server Docker Compose Docs

Observed result

RQ Jobs Failing

Expected result

Stacktrace / full error message if available

Docker Logs

Traceback (most recent call last):
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/rq/worker.py", line 1449, in perform_job job.execute_failure_callback(self.death_penalty_class, *exc_info)
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/rq/job.py", line 1429, in execute_failure_callback self.failure_callback(self, self.connection, *exc_info)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 565, in truncate_failed_registry conf frappe.conf if frappe.conf else appe.get_conf(site=job.kwargs.get("site"))
File "/home/frappe/frappe-bench/apps/frappe/frappe/_init_.py", line 399, in get_conf with init_site(site):
File "/home/frappe/frappe-bench/apps/frappe/frappe/_init_.py", line 409, in _enter_ init(self.site)
File "/home/frappe/frappe-bench/apps/frappe/frappe/_init_.py", line 239, in init local.conf = dict(get_site_config())
File "/home/frappe/frappe-bench/apps/frappe/frappe/_init__.py", line 337, in get_site_config
raise IncorrectSitePath(f"{local.site) does not exist")
frappe.exceptions.IncorrectSitePath: 404 Not Found: <sitename> does not exist

RQ Logs

image

@letajmal letajmal added the bug label Jul 16, 2024
@letajmal letajmal changed the title Issue with DNS Resolution in Docker Compose Single Server Multi Bench Setup RQ Logs frappe.exceptions.IncorrectSitePath: 404 Not Found: <sitename> does not exis Jul 20, 2024
@letajmal letajmal changed the title RQ Logs frappe.exceptions.IncorrectSitePath: 404 Not Found: <sitename> does not exis RQ Logs frappe.exceptions.IncorrectSitePath: 404 Not Found: <sitename> does not exist Aug 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

This issue has been automatically marked as stale. You have a week to explain why you believe this is an error.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant