Stream: warg

Topic: issues using cli


view this post on Zulip Daniel Macovei (Mar 08 2023 at 16:05):

Hey all. Started trying to work with the registry locally today. I'm running the server locally, and attempting to publish packages with the cli. I'm using warg-cli publish start --init <package-name> followed by warg-cli publish submit and getting the following
error: Record rejected for Non-initial record contained no previous hash
Server side I see this 2023-03-08T15:58:19.092615Z ERROR warg_server: Handler failed: A bundle can not be made from no proofs. Wondering if I'm failing to convey that the publish is an initial publish, even though the publish is started as an initial publish?

view this post on Zulip Peter Huene (Mar 08 2023 at 17:09):

looking at the cli code that was recently refactored, i believe it's calling start_publish_init, so it should be sending the public key to use to start the package log (it should print out that it's publishing a new package with --init passed), so perhaps there's something wrong with the server impl?

view this post on Zulip Peter Huene (Mar 08 2023 at 17:12):

Oh perhaps you're missing a release command in-between and it's just a bad error message?

view this post on Zulip Daniel Macovei (Mar 08 2023 at 18:39):

I can see an entry for the init and for the release in the publish-info.json after digging into the cli a bit, i think that maybe i missed a step where the packages folder was supposed to be populated? It's empty right now, and it looks like publish submit is trying to use stuff that's in there Screen-Shot-2023-03-08-at-12.37.14-PM.png

view this post on Zulip Peter Huene (Mar 08 2023 at 19:02):

Probably something related to the refactoring (I also need to update the demo scripts), I can look at it after the meeting

view this post on Zulip Daniel Macovei (Mar 08 2023 at 19:06):

Thanks! Yeah i was messing around with the demo too and updated some of the scripts to interact with it

view this post on Zulip Peter Huene (Mar 08 2023 at 19:07):

cool, sorry I missed that, feel free to PR those fixes in the mean time!

view this post on Zulip Peter Huene (Mar 08 2023 at 19:41):

so i patched enough of the client/server to get it working to the point of failure you're seeing. the publish operation appears to succeed, but the updating of the client to the response checkpoint is failing a consistency check

view this post on Zulip Peter Huene (Mar 08 2023 at 19:44):

and i believe it's due to what you're seeing, the packages directory not getting populated; likely from the refactoring of the client storage

view this post on Zulip Peter Huene (Mar 08 2023 at 19:46):

or maybe not (still pretty unfamiliar with the client/server code)

view this post on Zulip Peter Huene (Mar 08 2023 at 19:47):

seems like they're only stored after the checkpoint inclusion is proved

view this post on Zulip Peter Huene (Mar 08 2023 at 19:53):

the client impl needs some non-2xx-response handling too; several places try to parse JSON responses without a JSON response (i.e. when the server 500s), although these seem more like 400s to me (something wrong with the proof request data supplied)

view this post on Zulip Peter Huene (Mar 08 2023 at 20:03):

I put up https://github.com/bytecodealliance/registry/pull/71 with my fixes to get us to the same point of failure

This PR fixes some issues with running the demo after a refactoring to the CLI.

view this post on Zulip Peter Huene (Mar 08 2023 at 20:05):

@Kyle Brown would you mind looking into this issue (with PR 71 applied locally) as you're much more familiar with the server implementation than I? basically after a publish start --init, publish release, and publish submit for the demo, the submit fails because the checkpoint of the submission fails its inclusion proof

view this post on Zulip Peter Huene (Mar 08 2023 at 20:08):

it could be related to the CLI refactoring; I obviously didn't do a good enough job of verifying that the demo still worked post refactoring

view this post on Zulip Daniel Macovei (Mar 08 2023 at 20:37):

fwiw i rolled back before the cli refactor and i think the behavior predates that... or we're not running the proper commands

view this post on Zulip Robin Brown (Mar 08 2023 at 21:38):

I wouldn't be surprised if the issue does predate Peter's changes.

view this post on Zulip Robin Brown (Mar 08 2023 at 21:38):

Looking at it now, it looks like it came from when I refactored things after CNSC.

view this post on Zulip Robin Brown (Mar 08 2023 at 21:48):

@Peter Huene it's a pretty small issue due to my reorganization. The call to update_to in submit_publish fails because there is nothing to update. It's worth thinking about the right way to express this in the future, but for now you can just add self.install(name).await?; on the line above it.

view this post on Zulip Robin Brown (Mar 08 2023 at 21:48):

Let me know if you hit any other issues.

view this post on Zulip Peter Huene (Mar 08 2023 at 21:55):

Pushed the fix as part of that PR

view this post on Zulip Peter Huene (Mar 08 2023 at 21:55):

and verified it does the trick for now

view this post on Zulip Daniel Macovei (Mar 08 2023 at 22:01):

thanks again!


Last updated: Dec 23 2024 at 12:05 UTC