vrtmrz / obsidian-livesync

MIT License
5.06k stars 165 forks source link

Colab script does not generate setup URI #527

Open ikotamsl opened 1 week ago

ikotamsl commented 1 week ago

Abstract

Colab script does not generate setup URI

Expected behaviour

Actually happened

Colab script [3] fails with

--- setup uri  ---
error: Could not find a matching package for 'npm:octagonal-wheels@0.1.11' in the node_modules directory. Ensure you have all your JSR and npm dependencies listed in your deno.json or package.json, then run `deno install`. Alternatively, turn on auto-install by specifying `"nodeModulesDir": "auto"` in your deno.json file.
    at file:///content/obsidian-livesync/utils/flyio/generate_setupuri.ts:1:25

Failed to encrypt the setup URI

Reproducing procedure

  1. Execute each step of Colab Script
  2. Reach step [3]
  3. Run step

Report materials

Full log of step [3]

env: region=4444
[Errno 2] No such file or directory: 'obsidian-livesync/utils/flyio'
/content/obsidian-livesync/utils/flyio
-- YOUR CONFIGURATION --
URL     : 4444
username: 4444
password: 4444
region  : 4444

-- START DEPLOYING --> 
An existing fly.toml file was found
Using build strategies '[the "couchdb:latest" docker image]'. Remove [build] from fly.toml to force a rescan
Creating app in /content/obsidian-livesync/utils/flyio
We're about to launch your app on Fly.io. Here's what you're getting:

Organization: 4444                 (fly launch defaults to the personal org)
Name:         4444         (specified on the command line)
Region:       4444             (specified on the command line)
App Machines: shared-cpu-1x, 256MB RAM (from your fly.toml)
Postgres:     <none>                   (not requested)
Redis:        <none>                   (not requested)
Tigris:       <none>                   (not requested)

Created app '4444' in organization 'personal'
Admin URL: 4444
Hostname: 4444
Wrote config file fly.toml
Validating /content/obsidian-livesync/utils/flyio/fly.toml
✓ Configuration is valid
Your app is ready! Deploy with `flyctl deploy`
Secrets are staged for the first deployment
==> Verifying app config
--> Verified app config
Validating /content/obsidian-livesync/utils/flyio/fly.toml
✓ Configuration is valid
==> Building image
Searching for image 'couchdb:latest' remotely...
image found: img_ox20przww1q24j1z

Watch your deployment at 4444

Provisioning ips for 4444
  Dedicated ipv6: 4444
  Shared ipv4: 4444
  Add a dedicated ipv4 with: fly ips allocate-v4

Creating a 1 GB volume named 'couchdata' for process group 'app'. Use 'fly vol extend' to increase its size
This deployment will:
 * create 1 "app" machine

> Launching new machine
No machines in group app, launching a new machine
> Machine 4444 [app] was created
✔ Machine 4444 [app] update finished: success
Finished launching new machines

NOTE: The machines for [app] have services with 'auto_stop_machines = "stop"' that will be stopped when idling

Checking DNS configuration for 4444

Visit your newly deployed app at 4444
-- Configuring CouchDB by REST APIs... -->
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   158  100    12  100   146      6     77  0:00:02  0:00:01  0:00:01    84
{"ok":true}
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     3  100     6      3      7  0:00:01 --:--:--  0:00:01    11
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     3  100     6     11     22 --:--:-- --:--:-- --:--:--    34
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    28  100     3  100    25     11     97 --:--:-- --:--:-- --:--:--   109
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     3  100     6     11     23 --:--:-- --:--:-- --:--:--    34
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     3  100     6     11     23 --:--:-- --:--:-- --:--:--    34
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    15  100     3  100    12     11     46 --:--:-- --:--:-- --:--:--    58
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    13  100     3  100    10     11     38 --:--:-- --:--:-- --:--:--    49
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     3  100     6     11     23 --:--:-- --:--:-- --:--:--    34
""
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    61  100     3  100    58     11    225 --:--:-- --:--:-- --:--:--   237
""
<-- Configuring CouchDB by REST APIs Done!
OK!
Setup finished! Also, we can set up Self-hosted LiveSync instantly, by the following setup uri.
Passphrase of setup-uri will be printed only one time. Keep it safe!
--- configured ---
database       : 4444
E2EE passphrase: 4444
--- setup uri  ---
error: Could not find a matching package for 'npm:octagonal-wheels@0.1.11' in the node_modules directory. Ensure you have all your JSR and npm dependencies listed in your deno.json or package.json, then run `deno install`. Alternatively, turn on auto-install by specifying `"nodeModulesDir": "auto"` in your deno.json file.
    at file:///content/obsidian-livesync/utils/flyio/generate_setupuri.ts:1:25

Failed to encrypt the setup URI

Report from the LiveSync

not applicable

Obsidian debug info

not applicable

Plug-in log

not applicable

Network log

not applicable

Screenshots

not applicable

Other information, insights and intuition.

The synchronization itself works fine and I can connect to the database. The instance is created and is in state "Active". It seems like a dependency problem, that causes this minor inconvenience.

Anyway, thank you very much for your work!

vrtmrz commented 1 week ago

Thank you for reporting this issue! This seems to be caused by a major version update of Deno. I will address it later!

quyda88 commented 5 days ago

I also made it to this step! Please tell me how to copy the setup-uri into the Obsidian application. Thank you very much!

timschonborn commented 4 days ago

@ikotamsl did you manage to create the setup uri manually from the output? I don't seem to be able to get the encrypt() method working.

ikotamsl commented 4 days ago

@ikotamsl did you manage to create the setup uri manually from the output? I don't seem to be able to get the encrypt() method working.

Hi @timschonborn Didn't test that. I just saved my connection parameters and set up by pasting them on all my devices

timschonborn commented 4 days ago

@ikotamsl thanks for the swift reply. ~I feel like an idiot but I did't manage to get it working. I've saved the output, which parameters from the output did you use?~

I must have had a typo, it works now! Thanks

vrtmrz commented 4 days ago

Sorry for being late to address it! I have added the deno.jsonc, and modified the output order.

Therefore, the script and Colan notebook work again! Would you mind if I ask you to check the behaviour, please?

vrtmrz commented 4 days ago

Sorry! I noticed that I have to add several new configurations to the empty settings! Wait for a while to fix it a bit more! Thank you for your patience!