
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-07-2022 07:52 AM
Buenas compañeros,
Hoy me encontré con esta situación. En los tests previos que estamos realizando para el upgrade a San Diego, nos reportan un error. Cuando lo reviso es un flujo que está fallando. Falla en las 2 instancias que tenemos en San Diego y funciona OK en la que tenemos en Quebec. Todo indica es un error del upgrade a SD? O al menos, colateralmente.
Haciendo pruebas, veo que efectivamente, falla el flow. Pero cuando quiero ver el error, tanto si lo ejecuto desde el portal como si hago el test en Flow Designer, no puedo acceder a los logs. Lo desactivo y al querer activarlo, el error genérico de "Error al compilar el flow" que no dice más nada que eso y se queda ahí, tan tranquilo. Y no sabes como tirar para ver que es lo que genera el error.
Cree el caso en ServiceNow Support pero mientras me puse a buscar en la Comunidad y encontré esta pregunta: https://community.servicenow.com/community?id=community_question&sys_id=ff383070db2701d00d48db85ca96...
Por lo que ponía ahi (y podéis ver mi respuesta ahí también) era similar a lo que me pasaba.
El tema es: en el upgrade, se hace una compilación de los flows, y si por lo que sea, hay un error, el flow no compila y empieza a fallar con un error. Si no tenemos esto controlado (para eso ya os pasaré otra nota, me creé una database view para unir las tablas sys_hub_flow y sys_hub_context y poder agrupar por estado y nombre del flow cuales están fallando. La query es pesada, pero te sirve para ver cuantos están en error por ejemplo hoy y comparar con ayer, para ver si algo pasó). A lo que vamos, que me enrollo, el flujo fallaba y no sabíamos porqué.
Siguiendo este artículo https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0952645 inicialmente, vi que existe una columna en la tabla sys_hub_flow que es el "Compiler Build". Ahi pude ver que hay muchos de los flows aún en la versión de Quebec, entre ellos, el que fallaba. Eso ya me hizo pensar que estaba algo mal ahí.
Pero como cuando lo editas en Flow Designer el error es genérico, seguí buscando. Llegué a este artículo: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0963031. Aquí podéis ver como compilar mediante API un flujo, pero lo más útil es que el resultado te da pistas de que falla en el flujo (sino vas a ciegas).
Cree un fix script:
var compiledSuccessfully = sn_fd.FlowAPI.getRunner().flow('<IMPORTANTE: AQUI VA EL VALOR DE LA COLUMNA internal_name DE LA TABLA sys_hub_flow').compile();
gs.log('Result = ' + compiledSuccessfully);
Este fix script te lanza un jeroglífico con todo el stack de errores, pero si buscas el string "FAILED" es ahí donde tienes la pista de porque está fallando la compilación.
En mi caso algo así (no pongo aquí todo el stack, es grandísimo) pero mirar las lineas que he separado al final
Flow Designer: Begin creating Action "Update Record" (sys id 718471e2878dcd10a310baaabbbb3514) with order number 7 in flow and UUID 1b7df13a-91f2-400c-9842-186b92b808d9
Flow Designer: Begin creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with step number 1 of Action "Update Record" (sys id 718471e2878dcd10a310baaabbbb3514) with order number 7 in flow and UUID 1b7df13a-91f2-400c-9842-186b92b808d9
Flow Designer: Finished creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with an input count of 3 and an output count of 3 as step number 1 of Action "Update Record" with order number 7 in flow and UUID 1b7df13a-91f2-400c-9842-186b92b808d9
Flow Designer: Finished creating Action "Update Record" (sys id 718471e2878dcd10a310baaabbbb3514) with an input count of 3 an output count of 4 with order number 7 in flow and UUID 1b7df13a-91f2-400c-9842-186b92b808d9
Flow Designer: Begin creating Action "Update Record" (sys id 658431e2878dcd10a310baaabbbb35f7) with order number 10 in flow and UUID 73ee2b32-bebd-4e52-af87-bae15b0a46c7
Flow Designer: Begin creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with step number 1 of Action "Update Record" (sys id 658431e2878dcd10a310baaabbbb35f7) with order number 10 in flow and UUID 73ee2b32-bebd-4e52-af87-bae15b0a46c7
Flow Designer: Finished creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with an input count of 3 and an output count of 3 as step number 1 of Action "Update Record" with order number 10 in flow and UUID 73ee2b32-bebd-4e52-af87-bae15b0a46c7
Flow Designer: Finished creating Action "Update Record" (sys id 658431e2878dcd10a310baaabbbb35f7) with an input count of 3 an output count of 4 with order number 10 in flow and UUID 73ee2b32-bebd-4e52-af87-bae15b0a46c7
Flow Designer: Begin creating Action "Update Record" (sys id 718431e2878dcd10a310baaabbbb35fd) with order number 12 in flow and UUID b7dd3f74-e4ac-473b-8ef5-c1583cf327da
Flow Designer: Begin creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with step number 1 of Action "Update Record" (sys id 718431e2878dcd10a310baaabbbb35fd) with order number 12 in flow and UUID b7dd3f74-e4ac-473b-8ef5-c1583cf327da
Flow Designer: Finished creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with an input count of 3 and an output count of 3 as step number 1 of Action "Update Record" with order number 12 in flow and UUID b7dd3f74-e4ac-473b-8ef5-c1583cf327da
Flow Designer: Finished creating Action "Update Record" (sys id 718431e2878dcd10a310baaabbbb35fd) with an input count of 3 an output count of 4 with order number 12 in flow and UUID b7dd3f74-e4ac-473b-8ef5-c1583cf327da
Flow Designer: Flow CRM/Client Management Ticket Escalation form (sysid: d984fda2878dcd10a310baaabbbb35fb) compilation failed! INVALID/DELETED catalog variable found during flow publish:{{eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc.no_reason_escalation}}={{flow_variable.r3_resolved_butnotprocessed}}^{{eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc.centre_or_centretask}}={{flow_variable.centre_or_center_task_no_na}}: no thrown error
Flow Designer: Flow compilation Failed!
Flow Designer: Compiling flow CRM/Client Management Ticket Escalation form
Flow Designer: Begin creating Action "Get Catalog Variables" (sys id e98431e2878dcd10a310baaabbbb35ca) with order number 1 in flow and UUID eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc
Flow Designer: Begin creating Step "Get Catalog Variables Step" (sys id b70ba3abc31013002841b63b12d3aeff) with step number 1 of Action "Get Catalog Variables" (sys id e98431e2878dcd10a310baaabbbb35ca) with order number 1 in flow and UUID eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc
Flow Designer: Finished creating Step "Get Catalog Variables Step" (sys id b70ba3abc31013002841b63b12d3aeff) with an input count of 3 and an output count of 16 as step number 1 of Action "Get Catalog Variables" with order number 1 in flow and UUID eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc
Flow Designer: Finished creating Action "Get Catalog Variables" (sys id e98431e2878dcd10a310baaabbbb35ca) with an input count of 3 an output count of 15 with order number 1 in flow and UUID eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc
Action Step with name b70ba3abc31013002841b63b12d3aeff on Action Instance with id e98431e2878dcd10a310baaabbbb35ca has null stepErrorHandlingType. Setting to EVAL_ERRORS.
Flow Designer: Begin creating Action "Update Record" (sys id 758471e2878dcd10a310baaabbbb350e) with order number 4 in flow and UUID c80583fd-9f83-4254-852e-96baba03366c
Flow Designer: Begin creating Step "Update Record step " (sys id 5ad05916c31332002841b63b12d3ae63) with step number 1 of Action "Update Record" (sys id
Estas líneas te ponen sobre la pista:
Flow Designer: Flow CRM/Client Management Ticket Escalation form (sysid: d984fda2878dcd10a310baaabbbb35fb) compilation failed! INVALID/DELETED catalog variable found during flow publish:{{eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc.no_reason_escalation}}={{flow_variable.r3_resolved_butnotprocessed}}^{{eb81b9ff-a3ea-4402-bf68-b7ac8dd9e4bc.centre_or_centretask}}={{flow_variable.centre_or_center_task_no_na}}: no thrown error
Flow Designer: Flow compilation Failed!
Ahi te dice que una variable ha sido borrada, y efectivamente, fue borrada del catálogo y eso hace que si compilas nuevamente el flow, no compile y empiece a fallar. Quité esa variable de dos condiciones donde se usaba y el flow compiló y no falló.
Muchas preguntas quedan en el aire, pero al menos este artículo os servirá para, en caso de estar experimentado esto, tener por donde empezar.
Próximos pasos
- Ver en la tabla sys_hub_flow cuantos flujos están con "Compiler Build" que no sea San Diego
- Modificar el fix script para compilar masivamente todos
- De los que no compilen (me temo que los que no han compilado ya es porque tiene un error) empezar el troubleshooting (1 x 1, de la manera dificil y ardua, compilar, ver el error, corregir, volver a compilar, y volver empezar) 😞
- Implementar algún KPI (ya tengo el de los flujos con error) pero el del Compiler Build que no sea de la versión actual de la instancia nos puede dar pistas si algo va mal
Espero que os sirve, y como siempre, si me dáis "galletas" en forma de "useful" o "bookmarks" os lo agradezco 😉
Saludos para todos y buen verano!
PD: Se que estáis esperando las fotos y video del SNUG 6, en breve estarán!
- 400 Views