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

Regression in init subcommand: IOH.Base does not implement write_file #36

Closed
Peeperkorn opened this issue Nov 9, 2020 · 7 comments
Closed
Assignees
Labels
Acceptable Castle is in acceptable condition Bug A known issue causing a fully-implemented feature to fail External An issue submitted from the public
Milestone

Comments

@Peeperkorn
Copy link

Peeperkorn commented Nov 9, 2020

Heyhey, noob here. I wonder why I get error 127:

My command, in /usr/local/lib/node_modules/@castlelemongrab/parlance (there is no config folder there btw):

parlance init --mst "$mst" --jst "$jst" -o config/auth.json

(node:11054) UnhandledPromiseRejectionWarning: Error: Process exited with status 127

at IOH.fatal (/usr/local/lib/node_modules/@castlelemongrab/parlance/node_modules/@castlelemongrab/ioh/src/ioh.js:57:11)
at Session.write_credentials (/usr/local/lib/node_modules/@castlelemongrab/parlance/src/session.js:84:18)

(Use node --trace-warnings ... to show where the warning was created)
(node:11054) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:11054) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@pranithapat
Copy link
Collaborator

Were you able to resolve this issue? I'm having the same problem.

@castle-lemongrab
Copy link
Collaborator

Sorry for the delay in responding. I am able to reproduce this, and will get it fixed as soon as possible. We're a little bit disrupted by the pandemic over here, so I'm moving more slowly than I'd like to.

In the mean time, you should be able to create a compatible auth.json file by simply creating a file of the form { "mst": "...", "jst": "..." }, where each ellipsis has been replaced with the a non-urlencoded version of the token. If the token you have is URL-encoded (i.e. contains something like %2A), you should be able to use something like decodeURIComponent(mst) to get the plain-text representation.

This is pretty obviously a regression, so I'll attempt to prioritize it.

@castle-lemongrab castle-lemongrab self-assigned this Nov 13, 2020
@castle-lemongrab castle-lemongrab added Bug A known issue causing a fully-implemented feature to fail Unacceptable Castle is in unacceptable condition labels Nov 13, 2020
@castle-lemongrab castle-lemongrab added this to the The Enemy Is You milestone Nov 13, 2020
@castle-lemongrab castle-lemongrab added this to In Progress in Parlance Core Nov 14, 2020
castle-lemongrab added a commit that referenced this issue Nov 15, 2020
Refactoring in the IO subsystem (intended to make it easier to run
the client inside of an ordinary web browser in the near future)
led to the `init` subcommand attempting to use the *base* I/O
class instead of the Node-specific subclass. The base class leaves
`read_file` and `write_file` unimplemented, because there exists
no method of reading and writing files that's browser-portable.

Since this only runs under Node currently, use `IOH.Node`. Doh.
@castle-lemongrab
Copy link
Collaborator

This one was a complete facepalm; it should be fixed in 986542a. Let me know if any difficulty continues. I'll leave this open and merge in a unit testing framework and a couple of tests to guard against this sort of regression in the future. I'll also file an issue for end-to-end "it still works" testing.

I had some questions about how fast Parler's engineering team was able to move, and delayed introduction of proper TDD in anticipation of them rapidly changing interfaces/APIs. As it turns out, they are not moving very fast.

@castle-lemongrab castle-lemongrab changed the title failed to update credentials file error 127 Regression in init subcommand: IOH.Base does not implement write_file Nov 15, 2020
@castle-lemongrab
Copy link
Collaborator

Given that this issue lies in a critical path for people getting started, I'll go ahead and just add one unit test and push a new release; splitting off the other concerns. That way it'll work out of the box ASAP. Thanks for your patience.

@castle-lemongrab castle-lemongrab moved this from In Progress to Ready for Review in Parlance Core Nov 18, 2020
@castle-lemongrab castle-lemongrab added Acceptable Castle is in acceptable condition External An issue submitted from the public and removed Unacceptable Castle is in unacceptable condition labels Nov 23, 2020
@sipka
Copy link

sipka commented Nov 25, 2020

I have been tracking this as I am also hitting the issue and am therefore unable to use the API. Any suggested workaround until the issue gets reviewed and gets into the package? Thanks for your work, btw, this is would be a super helpful package for my research!

@castle-lemongrab
Copy link
Collaborator

I've released version 1.127.0 to Github and NPM to address this. If you're still seeing this issue or a similar issue after updating, let me know.

Given that Parler may be hanging around for a while, we intend to prioritize unit testing and end-to-end testing in the near term, as well as increase the frequency of NPM releases.

@sipka
Copy link

sipka commented Nov 26, 2020

All good now, thanks! I needed to do mkdir config manually first and then it was happy enough. Thank you!

@castle-lemongrab castle-lemongrab removed this from Ready for Review in Parlance Core Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acceptable Castle is in acceptable condition Bug A known issue causing a fully-implemented feature to fail External An issue submitted from the public
Projects
None yet
Development

No branches or pull requests

4 participants