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

jsonrpc --pipe non functioning #13824

Closed
WithHolm opened this issue Apr 8, 2024 · 3 comments
Closed

jsonrpc --pipe non functioning #13824

WithHolm opened this issue Apr 8, 2024 · 3 comments
Assignees

Comments

@WithHolm
Copy link

WithHolm commented Apr 8, 2024

Bicep version
0.26.54 (Windows)

Describe the bug
When following guidance to create a new bicep jsonrpc connection using named socket, it will not create a new socket that can be used.
Ive tried this on 3 different computer (2 windows 11 machines and a mac) but in none of the cases a new socket is created for consumption.

To Reproduce
Steps to reproduce the behavior:
run command: bicep jsonrpc --pipe \.\pipe\bicep-test-jsonrpc-sock.sock (or equivalent on mac)
run command (pwsh): get-childitem \.\pipe\ -Filter 'bicep' -Force
nothing shows up.

when trying to add "jsonrpc"=true to bicep config this also does not seem to do anything

Additional context
even if i use System.IO.Pipes.NamedPipeClientStream it stalls on connect() that hangs my current session.
i thought something was wrong and mabye pipes where blocked by fw of policy so i added bicep specifically to allow any actions through the computer firewall as well as wrote a small script to create a server using System.IO.Pipes.NamedPipeServerStream. it does seem to work, when testing that pipes are allowed to exist.

TRACE: Bicep version: 0.26.54+5e20b29b58, CLI arguments: "jsonrpc --pipe \\.\pipe\bicep-test-jsonrpc-sock.sock"
The 'jsonrpc' CLI command group is an experimental feature. Experimental features should be enabled for testing purposes only, as there are no guarantees about the quality or stability of these features. Do not enable these settings for any production usage, or your production environment may be subject to breaking.

@WithHolm WithHolm changed the title jsonrpc non functioning jsonrpc --pipe non functioning Apr 8, 2024
@anthony-c-martin
Copy link
Member

The --pipe flag instructs the CLI to connect to an existing JSONRPC server as a client via a named pipe, so in your example, you will have to pre-create the named pipe server and start listening on it, before invoking the command containing the name of the pipe.

Here's an example of what this looks like in C#, and here's an example in Node.

Apologies, this is not at all clear from the documentation - I will update it to clarify!

anthony-c-martin added a commit that referenced this issue Apr 8, 2024
@WithHolm
Copy link
Author

WithHolm commented Apr 8, 2024

Thank you for claryfying! I saw in the source that you used a client as part of the jsonrpc handler, but I thought it was some self tests to ensure connection.

In the edited documentation, it still says that you can use it as a server (line 2), is this still the case, and if so, how?

Also "version" is documented as "getversion"

@anthony-c-martin
Copy link
Member

Thanks for pointing out the additional documentation issues! I've submitted a PR here to address them: #13895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants