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

Notifications#event_payload too long #4161

Closed
hennevogel opened this issue Nov 27, 2017 · 8 comments
Closed

Notifications#event_payload too long #4161

hennevogel opened this issue Nov 27, 2017 · 8 comments
Labels
Bug Frontend Things related to the OBS RoR app

Comments

@hennevogel
Copy link
Member

There are over 400 exceptions in errbit about this. All for the openSUSE:Factory:Staging projects.

@jberry-suse looks like some script is passing too much data again.

I still think this should be medium text as mentioned in #3638

@hennevogel hennevogel added Bug Frontend Things related to the OBS RoR app labels Nov 27, 2017
@coolo
Copy link
Member

coolo commented Nov 27, 2017

this is the repo checker complaining about rubygems having file conflict between 2.4 and 2.5. For comments there should be a limit IMO - but this limit shouldn't be the event_payload, agreed :)

If @jberry-suse saw a '400 too much data in comments' instead of a 500, he would perhaps check his scripts :)

@jberry-suse
Copy link
Contributor

jberry-suse commented Nov 29, 2017

So as I asked for in the original issue...what limit do I use? I added comment truncation that handles formatting and what not properly, but need the limit. Last I checked it was working, but as discussed in original thread the implementation was done such that the limit is likely to be inconsistent since it depends on what else ends up in the payload.

https://github.com/openSUSE/osc-plugin-factory/blob/60cdcec090374af8f39002f60210b9ff505f4cdc/osclib/comments.py#L147-L176

I can just drop the limit by several thousand and cross my fingers. My $0.02 I would suggest picking a limit for comments that provides a margin for the notification mess and validate as such so a proper error is given and I'll use the same limit.

@jberry-suse
Copy link
Contributor

Also, I can look in the logs, but after I made the truncation I read logs regularly for several weeks and never saw issues. It seems like the comments are still created just not the notifications?

@coolo
Copy link
Member

coolo commented Nov 29, 2017

Don't you think that 64K of comment is too much - no matter if it ends up in a mail or not?

@coolo
Copy link
Member

coolo commented Nov 29, 2017

most of the issues exploding now are 'there is some generic problem with 2 sets of packages' - the exact number of files conflicting isn't that interesting.

IMO you're abusing the comment system there - and the build service should restrict comments to a saner level than 64K.

@hennevogel
Copy link
Member Author

@jberry-suse it's not about you. my mention was just meant informative :-)

@jberry-suse
Copy link
Contributor

Mixed messages. :-) Unless the notification payload is increased I will need to decrease tool limit to one number or another.

As to size of message, the goal was to provide feedback to user from the tool and the tool provides the message. Given that the tool does not provide structured output short of simply truncating the message it is a bit of work to condense it effectively. So as goes the rule the "simplest thing that can work" was done first as the primary goal was submitters actually being able to see the messages directly which was not previously possible and the other goals of the re-write which are not relevant to this discussion.

At this point we could look at parsing the text and condensing or just truncating to a shorter length. Alternatively, having a better place to store the data might be useful, but the comments being used for the purpose has become the norm for these tools, as you know, for lack of any better mechanism. One issue with shortening is that problems may end up being fixed in repeated batches due to not being able to see the full output. In some cases sure it is just a list of files between two packages, but in other large stagings it can be a series or more complex messages that involve multiple submissions. If the message is cut too short not everyone will see the messages effecting their package in the first round (or second, or third...). Obviously, this can still happen with the current max. Since the comments are always removed since stagings are re-used it is not as if these comments are being kept long-term and should only require storage of active set which does not increase over time.

Could additionally, upload the full message to pastebin, but most pastebins have a similar limit. So short of having a proper place to host the full output, or perhaps using one of various storage providers like S3 or somesuch comments are clearly the only real solution at the moment.

eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 3, 2018
- Add shorten_payload_if_necessary method in Notification model to be
sure that a payload is not bigger than the field size in database.
- This should fix openSUSE#4161.
eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 3, 2018
- Add shorten_payload_if_necessary method in Notification model to be
sure that a payload is not bigger than the field size in database.
- This should fix openSUSE#4161.
eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 4, 2018
- Add shorten_payload_if_necessary method in Notification model to be
sure that a payload is not bigger than the field size in database.
- This should fix openSUSE#4161.

Mobprogrammed with @mdeniz and @DavidKang.
eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 4, 2018
- Add shorten_payload_if_necessary method in Notification model to
ensure that a payload is not bigger than the field size in database.
- Modify the notifiction factory to allow passing parameters to
initialize.
- This should fix openSUSE#4161.

Mobprogrammed with @mdeniz and @DavidKang.
eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 4, 2018
- Add shorten_payload_if_necessary method in Notification model to
ensure that a payload is not bigger than the field size in database.
- Modify the notifiction factory to allow passing parameters to
initialize.
- This should fix openSUSE#4161.

Mobprogrammed with @mdeniz and @DavidKang.
eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 4, 2018
- Add shorten_payload_if_necessary method in Notification model to
ensure that a payload is not bigger than the field size in database.
- Modify the notifiction factory to allow passing parameters to
initialize.
- This should fix openSUSE#4161.

Mobprogrammed with @mdeniz and @DavidKang.
eduardoj added a commit to eduardoj/open-build-service that referenced this issue Jan 4, 2018
- Add shorten_payload_if_necessary method in Notification model to
ensure that a payload is not bigger than the field size in database.
- Modify the notification factory to allow passing parameters to
initialize.
- This should fix openSUSE#4161.

Mobprogrammed with @mdeniz and @DavidKang.
bgeuken added a commit to bgeuken/open-build-service that referenced this issue Jan 8, 2018
SendEventEmailsJob is creating notifications from certain events. As part
of this the serialized event payload is copied to the 'event_payload'
attribute.
Both models were using different serialization libraries (Yajl::Encoder
for events, ActiveSupport::JSON.encode for notifications), which could
cause the stored data format to differ, eg. active support encodes
certains chars differently.
In general this was not causing any trouble, because the decoded data
would be the same. But it could happen that the payload of the
notification is bigger than the original event payload and exceeds the
size limit of that field. In such a case the notification creation
failed with a ActiveRecord::ValueTooLong error.

By using the same serialization method in both places, we avoid this
from happening. Since notifications are created from events, and the
event payload length is already sanitized based on that serialization
method used by the event model, we pick the Yajl::Encoder.

Fixes openSUSE#3638 openSUSE#4161
bgeuken added a commit to bgeuken/open-build-service that referenced this issue Jan 8, 2018
SendEventEmailsJob is creating notifications from certain events. As part
of this the serialized event payload is copied to the 'event_payload'
attribute.
Both models were using different serialization libraries (Yajl::Encoder
for events, ActiveSupport::JSON.encode for notifications), which could
cause the stored data format to differ, eg. active support encodes
certains chars differently.
In general this was not causing any trouble, because the decoded data
would be the same. But it could happen that the payload of the
notification is bigger than the original event payload and exceeds the
size limit of that field. In such a case the notification creation
failed with a ActiveRecord::ValueTooLong error.

By using the same serialization method in both places, we avoid this
from happening. Since notifications are created from events, and the
event payload length is already sanitized based on that serialization
method used by the event model, we pick the Yajl::Encoder.

Fixes openSUSE#3638 openSUSE#4161
bgeuken added a commit to bgeuken/open-build-service that referenced this issue Jan 8, 2018
SendEventEmailsJob is creating notifications from certain events. As part
of this the serialized event payload is copied to the 'event_payload'
attribute.
Both models were using different serialization libraries (Yajl::Encoder
for events, ActiveSupport::JSON.encode for notifications), which could
cause the stored data format to differ, eg. active support encodes
certains chars differently.
In general this was not causing any trouble, because the decoded data
would be the same. But it could happen that the payload of the
notification is bigger than the original event payload and exceeds the
size limit of that field. In such a case the notification creation
failed with a ActiveRecord::ValueTooLong error.

By using the same serialization method in both places, we avoid this
from happening. Since notifications are created from events, and the
event payload length is already sanitized based on that serialization
method used by the event model, we pick the Yajl::Encoder.

Fixes openSUSE#3638 openSUSE#4161
bgeuken added a commit to bgeuken/open-build-service that referenced this issue Jan 8, 2018
SendEventEmailsJob is creating notifications from certain events. As part
of this the serialized event payload is copied to the 'event_payload'
attribute.
Both models were using different serialization libraries (Yajl::Encoder
for events, ActiveSupport::JSON.encode for notifications), which could
cause the stored data format to differ, eg. active support encodes
certains chars differently.
In general this was not causing any trouble, because the decoded data
would be the same. But it could happen that the payload of the
notification is bigger than the original event payload and exceeds the
size limit of that field. In such a case the notification creation
failed with a ActiveRecord::ValueTooLong error.

By using the same serialization method in both places, we avoid this
from happening. Since notifications are created from events, and the
event payload length is already sanitized based on that serialization
method used by the event model, we pick the Yajl::Encoder.

Fixes openSUSE#3638 openSUSE#4161
@eduardoj eduardoj changed the title Notifications#event_payload too small Notifications#event_payload too long Jan 11, 2018
@Ana06
Copy link
Member

Ana06 commented Feb 19, 2018

This should be done... closing!

@Ana06 Ana06 closed this as completed Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants