fortify / fcli

fcli is a command-line utility for interacting with various Fortify products
https://fortify.github.io/fcli/
Other
31 stars 17 forks source link

expired sessions - errors on deletion #356

Closed xakrurychle closed 1 year ago

xakrurychle commented 1 year ago

When a session is expired it still shows using ./fcli ssc session ls. Trying to delete the expired sessions by name. e.g. ./fcli ssc session logout proxySetSession -u <name> -p <pass>

this returns to stdout

java.lang.IllegalStateException: Error reading session descriptor, please try logging in again
        at com.fortify.cli.common.session.helper.AbstractSessionHelper.lambda$get$0(AbstractSessionHelper.java:51)
        at com.fortify.cli.common.session.helper.AbstractSessionHelper.conditionalThrow(AbstractSessionHelper.java:124)
        at com.fortify.cli.common.session.helper.AbstractSessionHelper.get(AbstractSessionHelper.java:51)
        at com.fortify.cli.common.session.cli.cmd.AbstractSessionLogoutCommand.getJsonNode(AbstractSessionLogoutCommand.java:33)
        at com.fortify.cli.common.output.cli.cmd.AbstractOutputCommand.run(AbstractOutputCommand.java:33)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2104)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2539)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2531)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2493)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2351)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2495)
        at picocli.CommandLine.execute(CommandLine.java:2248)
        at com.fortify.cli.app.FortifyCLI.execute(FortifyCLI.java:74)
        at com.fortify.cli.app.FortifyCLI.main(FortifyCLI.java:56)
Caused by: java.lang.IllegalStateException: SSC session 'proxySetSession' cannot be retrieved or has expired, please login again
        at com.fortify.cli.common.session.helper.AbstractSessionHelper.checkNonExpiredSessionAvailable(AbstractSessionHelper.java:130)
        at com.fortify.cli.common.session.helper.AbstractSessionHelper.get(AbstractSessionHelper.java:47)
        ... 11 more

when I then run ls command again, the deleted session is gone.

Shoul the user be receiving these errors? It does not seem like a defect but as a negative test I don't think this should be printed to stdout.