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] Radom BadNameSpaceError when starting a node #1333

Closed
hcadavid opened this issue Jun 14, 2024 · 0 comments
Closed

[Bug] Radom BadNameSpaceError when starting a node #1333

hcadavid opened this issue Jun 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@hcadavid
Copy link
Contributor

hcadavid commented Jun 14, 2024

Describe the bug
When starting a node (v6 node start), sometimes it crashes while trying to share its configuration with the server:

2024-06-14 12:32:58 - node           - DEBUG    - Sharing node configuration: {'encryption': True, 'allowed_algorithms': 'all', 'database_labels': ['default'], 'database_types': {'db_type_default': 'csv'}, 'database_columns': {'columns_default': ['Name', 'Age', 'Location']}}
Exception in thread Thread-6 (_handle_eio_message):
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/site-packages/socketio/client.py", line 705, in _handle_eio_message
    self._handle_event(pkt.namespace, pkt.id, pkt.data)
  File "/usr/local/lib/python3.10/site-packages/socketio/client.py", line 581, in _handle_event
    r = self._trigger_event(data[0], namespace, *data[1:])
  File "/usr/local/lib/python3.10/site-packages/socketio/client.py", line 636, in _trigger_event
    return self.namespace_handlers[namespace].trigger_event(
  File "/usr/local/lib/python3.10/site-packages/socketio/namespace.py", line 18, in trigger_event
    return getattr(self, handler_name)(*args)
  File "/vantage6/vantage6-node/vantage6/node/socket.py", line 46, in on_sync
    self.node_worker_ref.share_node_details()
  File "/vantage6/vantage6-node/vantage6/node/__init__.py", line 1096, in share_node_details
    self.socketIO.emit("node_info_update", config_to_share, namespace="/tasks")
  File "/usr/local/lib/python3.10/site-packages/socketio/client.py", line 393, in emit
    raise exceptions.BadNamespaceError(
socketio.exceptions.BadNamespaceError: /tasks is not a connected namespace.
2024-06-14 12:32:58 - socket         - INFO     - Node <collab-One - orgA> joined room <collaboration_1>

Despite the error, the node keeps running (in the UI it is shown as 'active'/green), and the problem is noticed only when you try to create a task (e.g., from the UI), as there are no databases to choose from.

This happens randomly, but happens almost 100% of the time when using nodes running within a SURF-RC Workspace (I still don't understand why). When running the node within the same v6-server's workspace, it happens around 50% of the time.

In my case, the v6-server is running through docker-compose, with an NGINX reverse proxy as an entry point for the API and the web-based UI:

server {
	listen 80 default_server;
	listen [::]:80 default_server;
	return 301 https://$host$request_uri;
}

server {
	# SSL configuration
	#
	listen 443 ssl default_server;
	listen [::]:443 ssl default_server;

	server_name ....;
	ssl_certificate ...;
	ssl_certificate_key ....;

        location /api {
          include proxy_params;
          #proxy_set_header Host $host;
          #proxy_set_header X-Real-IP $remote_addr;
          proxy_pass http://localhost:5000/api;
        }

        location / {
          #include proxy_params;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_pass http://localhost:8080/;


          sub_filter 'src="/' 'src="/ui/';
          sub_filter_once on;
          sub_filter_types text/html text/css application/javascript text/javascript;


	}

    	# Allow the websocket traffic
    	location /socket.io {
          include proxy_params;
          proxy_http_version 1.1;
          proxy_buffering off;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "Upgrade";
          proxy_pass http://127.0.0.1:5000/socket.io;
	}

}
@hcadavid hcadavid added the bug Something isn't working label Jun 14, 2024
@hcadavid hcadavid self-assigned this Jun 14, 2024
hcadavid added a commit that referenced this issue Jun 14, 2024

Unverified

No user is associated with the committer email.
…' option when the server creates SocketIO objects as discussed on miguelgrinberg/python-socketio#920. This fixes issue #1333
hcadavid added a commit that referenced this issue Jun 14, 2024

Unverified

No user is associated with the committer email.
…' option when the server creates SocketIO objects as discussed on miguelgrinberg/python-socketio#920.

This fixes issue #1333 (comming including blackformatting)
@bartvanb bartvanb added this to the 4.6 milestone Jul 2, 2024
@bartvanb bartvanb added this to Sprints Jul 2, 2024
@github-project-automation github-project-automation bot moved this to Todo in Sprints Jul 2, 2024
@bartvanb bartvanb moved this from Todo to To Test in Sprints Jul 2, 2024
@bartvanb bartvanb moved this from To Test to Done in Sprints Jul 16, 2024
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
Archived in project
Development

No branches or pull requests

2 participants