Skip to content

cscli papi status - unclear message for status 402 #4309

@mmetc

Description

@mmetc

What happened?

with a community plan:

cscli papi status
Error: cscli papi status: unable to get PAPI permissions: unable to query PAPI : Forbidden for plan '' (402)

It would be easy to check for 402 in the "papi status" command but then it wouldn't print the error string -- I think fixing that on the CAPI side would be better

What did you expect to happen?

the CAPI could return "The Polling API is a premium feature, you are on the free community plan". In case of status 402, a sentinel error can bubble up to replace the whole "unable to get permissions" with the remote message.

How can we reproduce it (as minimally and precisely as possible)?

register to capi on community plan then "cscli papi status"

Anything else we need to know?

No response

Crowdsec version

any

OS version

Details
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Enabled collections and parsers

Details
$ cscli hub list -o raw
# paste output here

Acquisition config

Details
# On Linux:
$ cat /etc/crowdsec/acquis.yaml /etc/crowdsec/acquis.d/*
# paste output here

# On Windows:
C:\> Get-Content C:\ProgramData\CrowdSec\config\acquis.yaml
# paste output here

Config show

Details
$ cscli config show
# paste output here

Prometheus metrics

Details
$ cscli metrics
# paste output here

Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.

Details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions