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

"invalid string format in UN/Locode" with "RU" locode #1394

Closed
532910 opened this issue May 18, 2022 · 2 comments · Fixed by #1403
Closed

"invalid string format in UN/Locode" with "RU" locode #1394

532910 opened this issue May 18, 2022 · 2 comments · Fixed by #1403
Assignees
Labels
U4 Nothing urgent

Comments

@532910
Copy link

532910 commented May 18, 2022

May 18 13:43:53 buky neofs-ir[82723]: 2022-05-18T13:43:53.504Z        warn        netmap/process_peers.go:49        could not verify and update information about network map candidate        {"error": "could not get locode record from DB: could not parse location: could not parse location code: invalid string format in UN/Locode"}
# grep UN-LOCODE /etc/neofs/storage/config.yaml
  attribute_0: UN-LOCODE:RU

https://service.unece.org/trade/locode/ru.htm

Solution

Add with explanations to ErrInvalidString error in

func FromString(s string) (*LOCODE, error) {

@alexvanin
Copy link
Contributor

https://service.unece.org/trade/locode/Service/LocodeColumn.htm#LOCODE

Thus, a complete UN/LOCODE is a combination of a 2-character country code and a 3-character location code

NeoFS node supports only complete UN/LOCODE separated by whitespace between country code and location code.

@cthulhu-rider
Copy link
Contributor

I propose to clarify format violation in error text.

@cthulhu-rider cthulhu-rider added U4 Nothing urgent and removed triage labels May 18, 2022
@cthulhu-rider cthulhu-rider added this to the v0.28.2 milestone May 19, 2022
@carpawell carpawell self-assigned this May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
U4 Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants