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

POST on existing network including "rulesSource" key => 500 "Internal error loading network." #608

Closed
cormacrelf opened this issue Oct 21, 2017 · 5 comments
Labels
Central & Network Management ZeroTier Central & networking management Type: Bug Bug to be resolved

Comments

@cormacrelf
Copy link

cormacrelf commented Oct 21, 2017

Smallest repro:

req.json

{
  "rulesSource": "accept;"
}
< req.json curl -H "Authorization: Bearer $ZEROTIER_API_KEY" -d @- https://my.zerotier.com/api/network/ -o net.json

# get the id from the output using https://stedolan.github.io/jq/
ID=$(jq -r .id < net.json)

# verify there's exactly one rule compiled
jq .config.rules < net.json

# update the network
< req.json curl -H "Authorization: Bearer $ZEROTIER_API_KEY" https://my.zerotier.com/api/network/$ID
# fails
# {"type":"internal","message":"Internal error loading network."}

The smallest repro doesn't require changing the "rulesSource" key between create and update, but doing so is no different.

Edit: added -r for raw jq output on id

Edit 2: I made a gist for a test case that changes the rulesSource and checks if the rules have changed. It also cleans up after itself so you can run it 1000x.

Expected behaviour:

The network should compile the new ruleset and respond without error including the new rules and metadata.

@laduke
Copy link
Contributor

laduke commented Oct 21, 2017

Thanks. I'll be taking a look.

@adamierymenko adamierymenko added Type: Bug Bug to be resolved Central & Network Management ZeroTier Central & networking management labels Oct 23, 2017
@laduke
Copy link
Contributor

laduke commented Oct 23, 2017

@cormacrelf thanks for the script. Fix should be in the next release of Central.

@cormacrelf
Copy link
Author

Lovely! How frequent are those?

@laduke
Copy link
Contributor

laduke commented Dec 18, 2017

@cormacrelf this one took longer than usual, but the update went out.

The gist seems to assert OK now. Closing issue but let us know.

@laduke laduke closed this as completed Dec 18, 2017
@cormacrelf
Copy link
Author

cormacrelf commented Dec 18, 2017

Awesome! Test passes. I'll exercise a bit more with my Terraform plugin.

Edit: seems fine. I've hit it a bunch of times now, haven't found any edge cases. I'm happy. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central & Network Management ZeroTier Central & networking management Type: Bug Bug to be resolved
Projects
None yet
Development

No branches or pull requests

3 participants