Check neofs-authmate parameters validity before a container creation #182

Closed
opened 2025-12-28 17:36:31 +00:00 by sami · 0 comments
Owner

Originally created by @aprasolova on GitHub (Mar 10, 2022).

Originally assigned to: @KirillovDenis on GitHub.

When I run neofs-authmate issue-secret command and make a mistake in options (wrong path to bearer rules file, for instance), upon command re-run with corrected options I get the error

$ neofs-authmate --debug --with-log issue-secret --wallet wallet.json --gate-public-key=<some-key> --peer s01.neofs.devenv:8080 --container-friendly-name fe060d87-25da-4ea1-9c9d-347aa6acf  --bearer-rules s3_bearer_rules.json
Enter password for wallet.json > 
2022-03-10T17:17:46.516+0300	DEBUG	authmate/main.go:429	prepare connection pool
2022-03-10T17:17:46.530+0300	INFO	authmate/authmate.go:235	check container or create	{"cid": "", "friendly_name": "fe060d87-25da-4ea1-9c9d-347aa6acf", "placement_policy": "REP 2 IN X CBF 3 SELECT 2 FROM * AS X"}
failed to issue secret: save container via connection pool: status: code = 1024 message = could not handle request: could not execute Put request: could not invoke method (putNamed): chain/client: contract execution finished with state FAULT; exception: at instruction 3117 (THROW): unhandled exception: "name is already taken"

If I change the --container-friendly-name value to another string, the command executes successfully.

I'd propose to check the options validity before a container creation.

Originally created by @aprasolova on GitHub (Mar 10, 2022). Originally assigned to: @KirillovDenis on GitHub. When I run `neofs-authmate issue-secret` command and make a mistake in options (wrong path to bearer rules file, for instance), upon command re-run with corrected options I get the error ``` $ neofs-authmate --debug --with-log issue-secret --wallet wallet.json --gate-public-key=<some-key> --peer s01.neofs.devenv:8080 --container-friendly-name fe060d87-25da-4ea1-9c9d-347aa6acf --bearer-rules s3_bearer_rules.json Enter password for wallet.json > 2022-03-10T17:17:46.516+0300 DEBUG authmate/main.go:429 prepare connection pool 2022-03-10T17:17:46.530+0300 INFO authmate/authmate.go:235 check container or create {"cid": "", "friendly_name": "fe060d87-25da-4ea1-9c9d-347aa6acf", "placement_policy": "REP 2 IN X CBF 3 SELECT 2 FROM * AS X"} failed to issue secret: save container via connection pool: status: code = 1024 message = could not handle request: could not execute Put request: could not invoke method (putNamed): chain/client: contract execution finished with state FAULT; exception: at instruction 3117 (THROW): unhandled exception: "name is already taken" ``` If I change the `--container-friendly-name` value to another string, the command executes successfully. I'd propose to check the options validity before a container creation.
sami 2025-12-28 17:36:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#182
No description provided.