UI: store.getters.zones.filter is not a function on first login for User-type roles (race between listZones and listApis)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript
- Domínio
- frontend
Direção de pesquisa
Comece por ui/src/store/modules/user.js e acompanhe GetInfo junto com listZones, listApis e GenerateRoutes para confirmar a condição de corrida relatada. Em seguida, inspecione as funções show em ui/src/config/section/network.js e os detalhes de vnfapp em busca das outras consultas de zona sem proteção. A issue estará concluída quando um novo login com o perfil descrito carregar sem o erro no console; verifique o comportamento relatado em uma nova sessão privada.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
problem
On a fresh session the UI stays empty and the console shows:
TypeError: store.getters.zones.filter is not a function
at Object.show (network.js)
...
at GenerateRoutes (permission.js)
A reload (F5) fixes it. We see it for users with a User-type role and a short API list; a DomainAdmin user with a longer API list usually does not hit it.
Cause: in ui/src/store/modules/user.js the state starts with zones: {} (an object, not an array). GetInfo starts listZones and listApis in parallel and dispatches GenerateRoutes as soon as listApis returns, without waiting for listZones. When listApis returns first, the show of the securitygroups section in ui/src/config/section/network.js calls store.getters.zones.filter(...) on {}. The createNetwork show and the vnfapp details have the same unguarded call. On a reload the cached branch of GetInfo commits the zones from local storage before anything else, so there is no race.
versions
Apache CloudStack 4.22.1.0 (management server and UI), KVM, advanced zones. Login via SAML2 (Keycloak). The same code (zones: {} and no wait on listZones before GenerateRoutes) is on the 4.22 branch and on main.
The steps to reproduce the bug
- Create a custom role of type User with a short allow-list that includes
listApis,listZones,listSecurityGroups,listUsers,listCapabilities,listLdapConfigurations,listNetworkServiceProvidersandcloudianIsEnabled, ending with*,deny. - Create an account with that role and a user, and authorise the user for SAML.
- Open a new private browser window and log in through SAML.
- In the network tab,
listApisreturns beforelistZones; the UI stays empty and the console showsstore.getters.zones.filter is not a function. - Press F5: the UI loads normally.
It is timing dependent: the shorter the API list of the role, the more often listApis wins.
What to do about it?
- Initialise
zonesas[]in the state ofui/src/store/modules/user.js. - Wait for
listZones(andSET_ZONES) before dispatchingGenerateRoutesinGetInfo. - Guard the
showfunctions inui/src/config/section/network.js(and thevnfappdetails) withArray.isArray(store.getters.zones).
Any one of the first two fixes the race; the guard makes the menu robust against a missing zone list.
- Linguagem predominante
- Java
- Estrelas
- 3.1k
- Forks
- 1.4k
- Merge médio
- 6d 1h
- PRs com merge (30d)
- 16
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/cloudstack
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/cloudstack#14900 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/cloudstack#14897 ·
Mantenedores costumam responder em até 1 dia
-
ROUTED VPC router drops replies to its own traffic over a private gatewayTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
apache/cloudstack#14784 ·
Mantenedores costumam responder em até 1 dia
-
Snapshot lookup by zone ignores the zone in its fallback (stray semicolon)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/cloudstack#14770 ·
Mantenedores costumam responder em até 1 dia
-
CKS: validate-cks-node merges missing package names into one string on Debian/UbuntuTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/cloudstack#14755 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/cloudstack
Issues semelhantes
-
bug needs triage
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 70/100
DSpace/DSpace#13391 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
升级 AIDEV 初始化基础镜像至 0.1.7Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabacklog kind/enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
TencentBlueKing/bk-job#4640 ·
Mantenedores costumam responder em até 1 dia
-
Identify Apache Seata as incubating in the GitHub repository descriptionTalvez já em andamento @slievrly assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
apache/incubator-seata#8404 ·
Mantenedores costumam responder em até 1 dia
-
Track FLINK-41442: on Flink 2.1+ an unaligned checkpoint can lose a split assigned just before itAbertaarea:docs bug module:bigtable module:spanner priority:P3 status:blocked-upstream
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
flink-gcp/flink-connector-gcp#2411 ·
Mantenedores costumam responder em até 1 dia
-
Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia