Status Update
Comments
lu...@gmail.com <lu...@gmail.com> #2
The validation is there, but the issue is that a formally valid groups file may actually contain an empty group UUID, which was supported and well tolerated for many releases.
The introduction of the persistent project cache with ""
into null
.
When the groups
is updated, the change is accepted because the data is valid and the project cache is fully loaded as expected. However, once the in-memory cache expires, the attempt to reload it using protobuf would fail because of NPE.
ap...@google.com <ap...@google.com> #4
Project: gerrit
Branch: stable-3.10
Author: Luca Milanesio <
Link:
Fix NPE when de-serializing ProjectConfig with empty Group UUID
Expand for full commit details
Fix NPE when de-serializing ProjectConfig with empty Group UUID
Protobuf is well-known for not managing correctly empty fields
values, therefore the custom serializer/deserializer has to take
into consideration and manage nulls coming from deserialization.
Handle the null UUID by adding a GroupReference with an empty
UUID string value, consistently with what was happening in Gerrit v3.2
or earlier.
Bug: Issue 383513682
Release-Notes: Fix Protobuf deserialization of project config with empty Group UUIDs
Forward-Compatible: checked
Change-Id: I935539c22675027b7fd9d480756ef858d4a874d3
Files:
- M
java/com/google/gerrit/entities/AccountGroup.java
- M
java/com/google/gerrit/entities/CachedProjectConfig.java
- M
javatests/com/google/gerrit/server/cache/serialize/entities/CachedProjectConfigSerializerTest.java
- M
javatests/com/google/gerrit/server/cache/serialize/entities/GroupReferenceSerializerTest.java
Hash: e8c4c03da5ccbe7a9e2a21bb2ef8144a2ad3637a
Date: Thu Dec 12 00:28:29 2024
Description
*** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!! *** Do not submit bugs for chrome/android and issues with your company's *** Gerrit setup here. Those issues belong in different issue trackers.
What steps will reproduce the problem?
52f0c08a09692cec1a468a459729f863a1771931 Administrators 82f4a7e33c01512f7808e87c327ef783b7a4f509 Service Users <THIS_IS_A_TAB>Fake Group global:Anonymous-Users Anonymous Users global:Project-Owners Project Owners global:Registered-Users Registered Users
What is the expected output? Gerrit should not allow the change since the group ID is not valid.
What do you see instead? Gerrit accepts the commit, and this creates a 500 when accessing projects list.
Not that it is also possible to reproduce the issue:
groups
via online editExample of stack trace when browsing the repos from the UI: