server
server copied to clipboard
BUG: Querying storageAggregator data, returns "null" and GA fails authorization
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Go to https://alkem.io/graphql
- Perform the following query with GA
query SpaceStorageAdminPage($spaceNameId: UUID_NAMEID!) {
space(ID: $spaceNameId) {
id
profile {
id
displayName
}
storageAggregator {
...StorageAggregator
}
}
}
fragment StorageAggregator on StorageAggregator {
id
parentEntity {
...StorageAggregatorParent
}
storageAggregators {
...LoadableStorageAggregator
}
storageBuckets {
...StorageBucket
}
directStorageBucket {
...StorageBucket
__typename
}
}
fragment StorageAggregatorParent on StorageAggregatorParent {
id
displayName
url
}
fragment LoadableStorageAggregator on StorageAggregator {
id
parentEntity {
...StorageAggregatorParent
}
}
fragment StorageBucket on StorageBucket {
id
size
documents {
...DocumentData
}
parentEntity {
...StorageBucketParent
}
}
fragment DocumentData on Document {
id
displayName
}
fragment StorageBucketParent on StorageBucketParent {
id
type
displayName
url
}
{
"spaceNameId": "building-alkemio-org"
}
- There are 2 issues
- Authorization error: "message": "User ([email protected]) does not have credentials that grant 'read' access to StorageAggregator.parentEntity",
- there are storageAggregator.parentEntity: null
Expected behavior All storageAggregator.parentEntity: have values GA don't get such error: "message": "User ([email protected]) does not have credentials that grant 'read' access to StorageAggregator.parentEntity",
@valentinyanakiev this is to do with storageAggregators it seems. The following query is simpler + still shows the issue:
query SpaceStorageAdminPage($spaceNameId: UUID_NAMEID!) {
space(ID: $spaceNameId) {
id
profile {
id
displayName
}
storageAggregator {
...StorageAggregator
}
}
}
fragment StorageAggregator on StorageAggregator {
id
parentEntity {
...StorageAggregatorParent
}
storageAggregators {
...LoadableStorageAggregator
}
}
fragment StorageAggregatorParent on StorageAggregatorParent {
id
displayName
url
}
fragment LoadableStorageAggregator on StorageAggregator {
id
parentEntity {
...StorageAggregatorParent
}
}
and then taking one of the storage aggregators that has issues:
query {
lookup {
storageAggregator(ID: "d3ff46db-a402-41d3-b168-811b4e081377") {
id
}
}
}
gives
So this may be a data integrity issue - will need some direct db access to triage further
Note: there are 16 challenges in the space, and the space storage aggregator has 20 children. So either the parent-child relationship on the storage aggregators are set wrong, or there is orphaned data.
The issue is still reproducible on PROD after orphaned data clean up