anvil-works / anvil-runtime

The runtime engine for hosting Anvil web apps
https://anvil.works/open-source
Other
874 stars 116 forks source link

The local DEV instructions are out of date? #60

Closed dldinternet closed 2 years ago

dldinternet commented 2 years ago

Hi there, I am not having much success with the instructions for Building and Running for Development in https://github.com/anvil-works/anvil-runtime/blob/master/doc/HACKING.md

The client works fine The server side refers to 'server/standalone' but I guessed it really means 'server/app-server' ... ? Then

↳ lein run repl
Injecting :aot list of ordered namespaces.
Unknown argument(s): repl
Available options:
...

So I try

↳ lein repl
Injecting :aot list of ordered namespaces.
Found 2 migration(s) for (base runtime) DB.
Executing Anvil migrations...
Database currently at "2021-06-19-runtime-sessions"
Database is already up to date.
[TRACE anvil.app-server.run] Invalidating; new version 1
[INFO  anvil.core.server] HTTP Server running on port 3000
[INFO  anvil.app-server.run] App URL:  https://MyLocalApp
[INFO  anvil.app-server.run] SMTP Server running on port 25
nREPL server started on port 63986 on host 127.0.0.1 - nrepl://127.0.0.1:63986
REPL-y 0.5.1, nREPL 0.8.3
Clojure 1.9.0
OpenJDK 64-Bit Server VM 1.8.0_322-b06
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

anvil.app-server.run=> [INFO  anvil.app-server.run] No downlink connected; postponing check for scheduled tasks

Finally for the downlink:

↳ python -m anvil_downlink_host.run
Connecting to ws://localhost:3000/_/downlink
Traceback (most recent call last):
  File "ws/.env/versions/3.7.12/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "ws/.env/versions/3.7.12/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "ws/anvil/anvil-runtime/downlink/python/anvil_downlink_host/run.py", line 4, in <module>
    anvil_downlink_host.run_downlink_host()
  File "ws/anvil/anvil-runtime/downlink/python/anvil_downlink_host/__init__.py", line 475, in run_downlink_host
    connection.connect()
  File "ws/.env/versions/MyLocalApp/lib/python3.7/site-packages/ws4py/client/__init__.py", line 217, in connect
    self.sock.connect(self.bind_addr)
ConnectionRefusedError: [Errno 61] Connection refused

No keepalive reply in 30 seconds. Exiting.

Can someone please help with updated instructions?

dldinternet commented 2 years ago

Ok some update I experimented and found this

JackN-code commented 2 years ago

Thanks so much for the info @dldinternet

meredydd commented 2 years ago

Hi @dldinternet - thanks for this report! The errors in HACKING.md will be updated in the next release.

(Just so you know, the correct fix for your downlink URL issue is not to edit the Python, but to set the DOWNLINK_SERVER environment variable before launching the downlink, following the instructions here. But I understand that, having encountered some out-of-date documentation already, you were already mistrusting the docs!)

meredydd commented 2 years ago

This is now fixed in v1.7.0 :)