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

connection refused #23

Closed
Thomas-Ganter opened this issue Sep 7, 2019 · 9 comments

Comments

@Thomas-Ganter
Copy link

commented Sep 7, 2019

Edit: obviously wrong title … I was making progress while writing the issue. Sorry about that.

With the instructions given, I am not able to make it run. And this is because I think some setup step is missing (or ambiguous).

I copied both the ~/.config/joplin and ~/.config/joplin-desktop directories to the docker host and still get this output:

Joplin Web - Starlette powered
2019-09-07 09:07:07,104 - INFO - Started server process [1]
2019-09-07 09:07:07,104 - INFO - Waiting for application startup.
2019-09-07 09:07:07,106 - INFO - Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)
2019-09-07 09:09:25,003 - INFO - ('127.0.0.1', 45768) - "GET / HTTP/1.1" 200
2019-09-07 09:10:15,144 - INFO - ('139.162.187.152', 53866) - "GET / HTTP/1.1" 200
2019-09-07 09:10:57,877 - INFO - ('127.0.0.1', 45794) - "GET / HTTP/1.1" 200
2019-09-07 09:10:57,998 - INFO - ('127.0.0.1', 45794) - "GET /static/css/chunk-vendors.css HTTP/1.1" 200
2019-09-07 09:10:58,024 - INFO - ('127.0.0.1', 45802) - "GET /static/js/app.js HTTP/1.1" 200
2019-09-07 09:10:58,024 - INFO - ('127.0.0.1', 45800) - "GET /static/js/chunk-vendors.js HTTP/1.1" 200
2019-09-07 09:11:00,334 - INFO - ('127.0.0.1', 45794) - "GET /favicon.ico HTTP/1.1" 404
2019-09-07 09:11:09,174 - INFO - ('127.0.0.1', 45806) - "GET /api/jw/folders/ HTTP/1.1" 500
2019-09-07 09:11:09,174 - ERROR - Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 375, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.6/site-packages/starlette/applications.py", line 134, in __call__
    await self.error_middleware(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 178, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 156, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 73, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 62, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 208, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
    response = await func(request)
  File "/app/app.py", line 127, in get_folders
    res = await joplin.get_folders()
  File "/usr/local/lib/python3.6/site-packages/joplin_api/core.py", line 257, in get_folders
    return await self.query('get', '/folders/', self.folder_fields)
  File "/usr/local/lib/python3.6/site-packages/joplin_api/core.py", line 100, in query
    res = await client.get(full_path, params=params)
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 379, in get
    trust_env=trust_env,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 626, in request
    trust_env=trust_env,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 197, in send
    allow_redirects=allow_redirects,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 234, in send_handling_redirects
    request, verify=verify, cert=cert, timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection_pool.py", line 124, in send
    raise exc
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection_pool.py", line 119, in send
    request, verify=verify, cert=cert, timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection.py", line 58, in send
    await self.connect(verify=verify, cert=cert, timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection.py", line 87, in connect
    stream = await self.backend.connect(host, port, ssl_context, timeout)
  File "/usr/local/lib/python3.6/site-packages/httpx/concurrency/asyncio.py", line 188, in connect
    timeout.connect_timeout,
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/asyncio/streams.py", line 81, in open_connection
    lambda: protocol, host, port, **kwds)
  File "uvloop/loop.pyx", line 1904, in create_connection
  File "uvloop/loop.pyx", line 1883, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 111] Connection refused
2019-09-07 09:11:09,177 - INFO - ('127.0.0.1', 45810) - "GET /api/jw/tags/ HTTP/1.1" 500
2019-09-07 09:11:09,177 - ERROR - Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 375, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.6/site-packages/starlette/applications.py", line 134, in __call__
    await self.error_middleware(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 178, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 156, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 73, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 62, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 208, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
    response = await func(request)
  File "/app/app.py", line 149, in get_tags
    res = await joplin.get_tags()
  File "/usr/local/lib/python3.6/site-packages/joplin_api/core.py", line 341, in get_tags
    return await self.query('get', '/tags/')
  File "/usr/local/lib/python3.6/site-packages/joplin_api/core.py", line 100, in query
    res = await client.get(full_path, params=params)
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 379, in get
    trust_env=trust_env,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 626, in request
    trust_env=trust_env,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 197, in send
    allow_redirects=allow_redirects,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 234, in send_handling_redirects
    request, verify=verify, cert=cert, timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection_pool.py", line 124, in send
    raise exc
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection_pool.py", line 119, in send
    request, verify=verify, cert=cert, timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection.py", line 58, in send
    await self.connect(verify=verify, cert=cert, timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection.py", line 87, in connect
    stream = await self.backend.connect(host, port, ssl_context, timeout)
  File "/usr/local/lib/python3.6/site-packages/httpx/concurrency/asyncio.py", line 188, in connect
    timeout.connect_timeout,
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/asyncio/streams.py", line 81, in open_connection
    lambda: protocol, host, port, **kwds)
  File "uvloop/loop.pyx", line 1904, in create_connection
  File "uvloop/loop.pyx", line 1883, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 111] Connection refused
2019-09-07 09:11:09,286 - INFO - ('127.0.0.1', 45818) - "GET /api/jw/notes/ HTTP/1.1" 500
2019-09-07 09:11:09,286 - ERROR - Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/uvicorn/protocols/http/httptools_impl.py", line 375, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.6/site-packages/starlette/applications.py", line 134, in __call__
    await self.error_middleware(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 178, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 156, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 73, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 62, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 352, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 590, in __call__
    await route(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 208, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
    response = await func(request)
  File "/app/app.py", line 138, in get_notes
    res = await joplin.get_notes()
  File "/usr/local/lib/python3.6/site-packages/joplin_api/core.py", line 161, in get_notes
    return await self.query('get', '/notes/', self.note_fields)
  File "/usr/local/lib/python3.6/site-packages/joplin_api/core.py", line 100, in query
    res = await client.get(full_path, params=params)
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 379, in get
    trust_env=trust_env,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 626, in request
    trust_env=trust_env,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 197, in send
    allow_redirects=allow_redirects,
  File "/usr/local/lib/python3.6/site-packages/httpx/client.py", line 234, in send_handling_redirects
    request, verify=verify, cert=cert, timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection_pool.py", line 124, in send
    raise exc
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection_pool.py", line 119, in send
    request, verify=verify, cert=cert, timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection.py", line 58, in send
    await self.connect(verify=verify, cert=cert, timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/httpx/dispatch/connection.py", line 87, in connect
    stream = await self.backend.connect(host, port, ssl_context, timeout)
  File "/usr/local/lib/python3.6/site-packages/httpx/concurrency/asyncio.py", line 188, in connect
    timeout.connect_timeout,
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/asyncio/streams.py", line 81, in open_connection
    lambda: protocol, host, port, **kwds)
  File "uvloop/loop.pyx", line 1904, in create_connection
  File "uvloop/loop.pyx", line 1883, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 111] Connection refused

I can read and understand the meaning of Connection refused -- however I find nowhere to configure the connection to my Joplin Notes (stored on my nextcloud) in the first place …

… so, what am I missing?

@foxmask foxmask changed the title KeyError: "Config 'JW_DEBUG' is missing, and has no default." connection refused Sep 7, 2019

@foxmask

This comment has been minimized.

Copy link
Owner

commented Sep 7, 2019

the "connection refused" is related to joplin that is not started or to docker that has not been started with --network="host" ?

how do you start docker ?

@Thomas-Ganter

This comment has been minimized.

Copy link
Author

commented Sep 7, 2019

(Almost) as per the example instructions like such:

docker run --network="host" -p 8001:8001 -v /root/.config/joplin-desktop/resources:/home/doe/.config/joplin-desktop/resources  joplin-web-build

And this is my .env file in the docker container:

db ➜  ~  cat Docker/joplin/joplin_web/.env
# running in debug mode or not ?
JW_DEBUG = False
# number of notes to get for each page
JW_PAGINATOR = 20
# listen port number
JW_HTTP_PORT = 8001
# the token ID you grab from the WebClipper config page with your Joplin
JOPLIN_WEBCLIPPER_TOKEN = '2c5...c70'
# path to get the joplin `resources` to be able to display them
JOPLIN_RESOURCES = '/home/doe/.config/joplin-desktop/resources/'

I'm almost certain I miss something which is obvious to you but which I'm ignorant of.

Does the Web UI require any additional installation to be existant?

@Thomas-Ganter

This comment has been minimized.

Copy link
Author

commented Sep 7, 2019

joplin that is not started

Aah – wit right there. So I need to have a Joplin actually running on that same machine (which in my case is a virtual root host somewhere).

So … hmm … how would I do that? Joplin CLI sufficient (I guess I have no X11 running on the Docker host)? Or would I run Joplin App itself in another Docker container?

@foxmask

This comment has been minimized.

Copy link
Owner

commented Sep 7, 2019

The goal is to find the webclipper port opened.
Today I think Joplin command line does not bootstrap the webclipper port.

@foxmask

This comment has been minimized.

Copy link
Owner

commented Sep 7, 2019

Just to be sure, I suppose /home/doe is for the example and not the right path to you joplin installation? Or did you copy the path from the project readme?

@Thomas-Ganter

This comment has been minimized.

Copy link
Author

commented Sep 8, 2019

Just to be sure, I suppose /home/doe is for the example and not the right path to you joplin installation? Or did you copy the path from the project readme?

Yes, absolutely. I left the path as set in the sample env file and used the docker -v option to map the physical path to the docker container filesysem path.

That was my original error (hence the originally wront title). But I now know that I somehow need to make a Joplin client running on the same machine as the web app docker container -- I'm not entirely sure yet how to do that.

@foxmask

This comment has been minimized.

Copy link
Owner

commented Sep 8, 2019

Actually I use Joplin Desktop and joplin-web on the same workstation.
It's working fine but if we could have a joplin webclipper port opened by the joplin terminal that will be great.
Until then that's all I can do.

@foxmask foxmask closed this Sep 8, 2019

@foxmask

This comment has been minimized.

@foxmask

This comment has been minimized.

Copy link
Owner

commented Sep 9, 2019

if you update the joplin terminal version by

NPM_CONFIG_PREFIX=~/.joplin-bin npm install -g joplin

then you should be able to run an headless joplin like this :

 joplin --profile ~/.config/joplin-desktop/ server start
2019-09-09 10:42:21: "Starting Clipper server on port 41184"

and then the joplin-web project can be usable on a dedicated server, and no just on a workstation

I will update the README with that new tips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.