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

couldn't get it working: on_off_identity subcommand #493

Closed
qrkourier opened this issue Sep 20, 2022 · 4 comments · Fixed by #681
Closed

couldn't get it working: on_off_identity subcommand #493

qrkourier opened this issue Sep 20, 2022 · 4 comments · Fixed by #681

Comments

@qrkourier
Copy link
Member

I tried to disable an identity with the on_off_identity subcommand, but I couldn't find a way to get it working based on the built-in usage hints. I'm assuming the correct value for --identity is the filesystem path to the identity config file.

❯ /opt/openziti/bin/ziti-edge-tunnel on_off_identity --identity /opt/openziti/etc/identities/webhookz1-client1.json --onoff
Unknown option ':'
on_off_identity: unrecognized option '--onoff'
Unknown option '?'

❯ /opt/openziti/bin/ziti-edge-tunnel on_off_identity --identity /opt/openziti/etc/identities/webhookz1-client1.json -o     
Unknown option ':'
on_off_identity: option requires an argument -- 'o'
Unknown option '?'

❯ /opt/openziti/bin/ziti-edge-tunnel on_off_identity -h                                                                  
ziti-edge-tunnel on_off_identity: enable/disable the identities information
usage: ziti-edge-tunnel on_off_identity [-i <identity>] [-o <onoff>]

        -i|--identity   identity info that needs to be enabled/disabled
        -o|--onoff      enable/disable the identity


❯ /opt/openziti/bin/ziti-edge-tunnel on_off_identity --identity /opt/openziti/etc/identities/webhookz1-client1.json -o disable
Unknown option ':'
@qrkourier
Copy link
Member Author

❯ /opt/openziti/bin/ziti-edge-tunnel version
v0.19.9-local

@qrkourier
Copy link
Member Author

In v0.21.0 it still doesn't seem to be possible to toggle identities' active status with on_off_identity. The usage hints built in to the CLI don't make sense to me.

"on_off_identity", "enable/disable the identities information", "[-i <identity>] [-o <onoff>]

From reading ziti-edge-tunnel.c, I gather that an arg to option -o of a upper or lower "t" is interpreted as true, which I'm guessing means to invert the status of the identity. However, I can only get a segfault with the many combinations of options and arguments I've tried.

Core was generated by `ziti-edge-tunnel on_off_identity --identity /opt/openziti/etc/identities/mfa3.j'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd2fc4a54c9 in arena_for_chunk (ptr=0x7ffc06dcb7fa) at ./malloc/arena.c:156
156     ./malloc/arena.c: No such file or directory.
(gdb) bt
#0  0x00007fd2fc4a54c9 in arena_for_chunk (ptr=0x7ffc06dcb7fa) at ./malloc/arena.c:156
#1  arena_for_chunk (ptr=0x7ffc06dcb7fa) at ./malloc/arena.c:160
#2  __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3390
#3  0x000055684e826ce1 in _free_string (s=0x7ffc06dca890) at /github/workspace/build/_deps/ziti-sdk-c-src/library/model_support.c:1113
#4  0x000055684e8298c3 in model_free (meta=<optimized out>, obj=<optimized out>) at /github/workspace/build/_deps/ziti-sdk-c-src/library/model_support.c:470
#5  model_free (obj=0x7ffc06dca890, meta=0x55684e90d580 <tunnel_on_off_identity_META>) at /github/workspace/build/_deps/ziti-sdk-c-src/library/model_support.c:456
#6  0x000055684e84ba1c in free_tunnel_on_off_identity (v=<optimized out>) at /github/workspace/lib/ziti-tunnel-cbs/ziti_tunnel_ctrl.c:1251
#7  0x000055684e81185f in on_off_identity_opts (argc=<optimized out>, argv=<optimized out>) at /github/workspace/programs/ziti-edge-tunnel/ziti-edge-tunnel.c:2378
#8  0x000055684e812585 in commandline_run (command=<optimized out>, argc=3, argv=0x7ffc06dcaa60) at /github/workspace/build/_deps/subcommand-src/commandline.h:83
#9  0x000055684e8098ce in main (argc=4, argv=0x7ffc06dcaa58) at /github/workspace/programs/ziti-edge-tunnel/ziti-edge-tunnel.c:3198

@dovholuknf
Copy link
Member

dovholuknf commented Apr 11, 2023

Can you try to toggle from the new preview UI? I'd like to know if you get the same issue
image

@qrkourier
Copy link
Member Author

Toggling in the UI works great! I confirmed by parsing the output of ZET's tunnel_status command for the value of Active.

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

Successfully merging a pull request may close this issue.

2 participants