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

Original resource ID not long enough for Swift container names #1436

Open
Callum027 opened this issue Jan 14, 2025 · 2 comments
Open

Original resource ID not long enough for Swift container names #1436

Callum027 opened this issue Jan 14, 2025 · 2 comments

Comments

@Callum027
Copy link
Contributor

Callum027 commented Jan 14, 2025

Gnocchi only allows original resource IDs up to 255 characters long.

In Ceilometer the resource ID for an object storage container is created by appending the container name to the project ID with / as a separator. Since in Swift container names can be up to 256 characters long, this results in a maximum resource ID of length 289 characters.

This results in Ceilometer being unable to push object storage metrics to Gnocchi when container names are at least 223 characters long.

Given that Ceilometer has used this format for a long time I'm assuming that Gnocchi not accommodating the maximum possible length is unintentional, so I'm creating a bug report here.

Which version of Gnocchi are you using

Latest master.

How to reproduce your problem

  1. Create a Swift container name at least 223 characters long, and create an object of non-zero size so that it gets sampled.
  2. Allow Ceilometer to sample it using one of the object storage usage pollsters (e.g. storage.containers.objects.size).

What is the result that you get

In ceilometer-agent-notification.log:

2025-01-15 11:47:19.644 51 ERROR ceilometer.dispatcher.gnocchi [-] {u'reason': u"transformable resource id >255 max allowed characters @ data['9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']", u'cause': u'Invalid input', u'detail': [u'9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']} (HTTP 400): BadRequest: {u'reason': u"transformable resource id >255 max allowed characters @ data['9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']", u'cause': u'Invalid input', u'detail': [u'9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']} (HTTP 400)

What is result that you expected

Sample polled correctly, with the corresponding resource created in Gnocchi.

@Callum027 Callum027 changed the title Resource ID max length not long enough for max length Swift containers Original resource ID not long enough for max length Swift containers Jan 14, 2025
@Callum027 Callum027 changed the title Original resource ID not long enough for max length Swift containers Original resource ID not long enough for Swift container names Jan 14, 2025
@Callum027
Copy link
Contributor Author

Related: Gnocchi resource types only allow string metadata fields to be up to 255 characters long, meaning that resource metadata also cannot store Swift container names that are 256 characters long.

meta_schema_ext = {
voluptuous.Required('min_length', default=0):
voluptuous.All(int, voluptuous.Range(min=0, max=255)),
voluptuous.Required('max_length', default=255):
voluptuous.All(int, voluptuous.Range(min=1, max=255))
}

@Callum027
Copy link
Contributor Author

Callum027 commented Jan 16, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant