aleph-im / aleph-vm

Aleph.im VM execution engine
MIT License
42 stars 18 forks source link

Creating a non-Python program on Aleph-VM #123

Closed aliel closed 11 months ago

aliel commented 2 years ago

Describe the bug Cannot connect to host localhost:8080 ssl:default [Connect call failed ('127.0.0.1', 8080)]

To Reproduce Follow the tutorial step => https://github.com/aleph-im/aleph-vm/blob/main/tutorials/SERVER.md

Steps to reproduce the behavior: curl http://program_url

Expected behavior Expected to got an HTTP 200 status

Screenshots

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
    sock = await self._connect_sock(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
    return await fut
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 8080)

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

Traceback (most recent call last):
  File "/root/init1.py", line 365, in process_instruction
    await run_executable_http(scope=payload.scope)
  File "/root/init1.py", line 319, in run_executable_http
    headers, body = await make_request(session, scope)
  File "/root/init1.py", line 288, in make_request
    async with session.request(
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8080 ssl:default [Connect call failed ('127.0.0.1', 8080)]
hoh commented 2 years ago

I cannot reproduce this issue on Debian Bullseye (amd64). I did however face the following issue: https://github.com/aleph-im/aleph-vm/issues/124

hoh commented 2 years ago

This was reported as a bug local to the developer's system.

aliel commented 1 year ago

I have reopened this issue due to the progress of the investigation.

Affect custom python script, shell scripts that are related to the Python environnement related #232 ?

The hostname of the vms exceeds 63 Characters as also descibed here => https://github.com/aleph-im/aleph-vm/blob/main/vm_supervisor/views.py#L47

and makes the vm crash

aliel commented 11 months ago

fixed by: https://github.com/aleph-im/aleph-vm/pull/283