Gandi / gandi.cli

⚠ ARCHIVED - Command line interface to Gandi.net products using the public API
http://cli.gandi.net/
GNU General Public License v3.0
347 stars 62 forks source link

string 'https://rpc.gandi.net/xmlrpc' does not match '^[a-z0-9]{24}$'] #269

Closed kopax closed 5 years ago

kopax commented 5 years ago

Hi everyone.

I have a small script that used to create the certificate from Gandi.

The script is today failing with Error: Gandi API has returned an error: <Fault 500037: "Error on object : OBJECT_UNKNOWN (CAUSE_BADPARAMETER) [string 'https://rpc.gandi.net/xmlrpc' does not match '^[a-z0-9]{24}$']">

I have decided to install gandi.cli on my host and reproduce. The error is also happening when I do:

$ apt-get install python-pip -y
$ pip install gandi.cli
$ echo 'export PATH=$PATH:~/.local/bin' | tee -a ~/.bash_env
$ gandi setup
$ gandi certificate list
Usage: gandi certificate list [OPTIONS]

Error: Gandi API has returned an error: <Fault 500037: "Error on object : OBJECT_UNKNOWN (CAUSE_BADPARAMETER) [string 'https://rpc.gandi.net/xmlrpc' does not match '^[a-z0-9]{24}$']">

Any Idea how to fix that? I have to renew certs before 29th of september and we want to do it from command line.

aegiap commented 5 years ago

The configuration file for GANDI CLI in $HOME/.config/gandi/config.yaml should begin with:

api:
    host: https://rpc.gandi.net/xmlrpc/
    key: YYYYYYYYYYYYYYYYYYYYYY
apirest:
    key: XXXXXXXXXXXXXXXXXXXXXX

Your entry host and key may be mixup as the regexp seems to be used for key pre-validation.

kopax commented 5 years ago

Hi @aegiap that was that.

I have looked at the documentation and I messed up with APIREST_KEY and API_KEY when I was working in last january. When I worked again I messed up again.

The documentation doesn't say where to generate each and for what feat exactly one should be use.

I have generated a new unique API key at https://account.gandi.net/fr/users/kopax/security/apikey and the old one is still working.

I also had to edit my source code to replace APIREST_KEY=${value} with API_KEY=${value}, but this was working before so I may have set both or one was picked up by the program. In all case I messed up and I don't know how to reconcile.

grigouze commented 5 years ago

I think it's now ok, we can close the issue