Collection was modified; enumeration operation may not execute

The following code and other similar ones some times gives this error

image

“Collection was modified; enumeration operation may not execute.”

New-UdColumn -Size 1.5 {
New-UDCard -Title "Automatic Services" -TextSize Medium -Endpoint {
							$SVCCT = (Get-Service -ComputerName $Session:CurrentServerIP | where {
									$_.StartType -eq "Automatic" -and $_.Status -eq "Stopped" }).count
	$SVCTXT = "$SVCCT Stopped Services"
	New-UDButton -Text $SVCTXT -Icon stop_circle -IconAlignment left -OnClick {
		Show-UDModal -Content {
									New-UdGrid -Title "Automatic And Stopped Services" -NoPaging -NoFilter -NoExport -Headers @(
										"Name", "Display Name", "Status") -Properties @("Name", "DisplayName", "Status") -Endpoint {
										Get-Service -ComputerName $Session:CurrentServerIP | where {
											$_.StartType -eq "Automatic" -and $_.Status -eq "Stopped"
										} | select "Name", "DisplayName", "Status" | Out-UDGridData
			}
		}
	}
}

Appreciate if any one can help, i am spinning around with no results.

Can you enable udlogging? I wonder if this is a UD bug or something else.

actually the only way to do this while not sharing the sensitive data is to refresh the page several times

the behavior is as following ,

first run it works fine

when i do refresh several times i get

then it get’s worth

OK i removed the collapsible which has the sensitive info and kept the ones with issues

here is the log

22:50:42 [Debug] NewElementCommand HTML
22:50:43 [Debug] EndpointService Register() 3eb980aa-f806-42b1-a32c-6eb2c145a951
22:50:43 [Debug] EndpointService Unregister() 3eb980aa-f806-42b1-a32c-6eb2c145a951
22:50:43 [Debug] NewElementCommand { "tag":"div", "attributes":{ "className":"row" }, "events":[], "type":"element", "key":"7b0a893b-962e-472d-ba2e-e010ce48cd06", "onMount":null, "id":"3eb980aa-f806-42b1-a32c-6eb2c145a951", "refreshInterval":5, "autoR
efresh":false, "hasCallback":true
}
22:50:43 [Debug] NewPageCommand {
	"type":"page", "name":"ServerInfo", "url":null, "defaultHomePage":false, "icon":"None", "components":[{ "tag":"div", "attributes":{ "className":"row" }, "events":[], "type":"element", "key":"f1e7c949-5e13-4b61-9057-289e
3aad3a90", "onMount":null, "id":"3eb980aa-f806-42b1-a32c-6eb2c145a951", "refreshInterval":5, "autoRefresh":false, "hasCallback":true
	}], "dynamic":false, "title":null, "id":"1619021c-e5d4-435b-9ab6-6594fe22d7e2", "refreshInterval":5, "autoRefresh":fal
	se, "hasCallback":false
}
22:50:43 [Debug] ThemeService {
	"name":"Azure", "definition":{
		".modal":{ "background-color":"#a3a3a3", "color":"#000", "width":"90% !important", "max-height":"90% !important", "z-index":"9999 !important", "max-width":"90% !important" }, "UDCounter":{
			"border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF"
		}, "h3, h4":{ "color":"#fff", "line-height":"110%" }, ".select-wrapper input.select-dropdown":{ "color":"#ffffff", "border-block-end-color":"#55b3ff", "border-bottom":"1px soli
d #55b3ff"
		}, ".sidenav .subheader":{ "font-size":"18px", "color":"#fff" }, ".tabs .tab a.active":{ "color":"#55b3ff", "background-color":"#1c1c1c" }, "UDTable":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".dropdown-con
tent":{ "background-color":"#333333" }, ".card .card-action a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-floating)":{ "color":"#55b3ff", "text-transform":"uppercase", "margin-right":"24px", "-webkit-transition":"color .3s e
ase", "transition":"color .3s ease"
		}, ".sidenav li > a":{ "font-size":"18px", "color":"#f1f1f1" }, ".sidenav .collapsible-header":{ "font-size":"18px", "color":"#fff !important", "background-color":"#1c1c1c !important" }, ".collection .collection-item
":{ "background-color":"#252525" }, ".tabs .tab a:hover":{ "color":"#55b3ff", "background-color":"#252525" }, "UDGrid":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".btn-flat":{ "color":"#fff" }, "UDDashboard":{ "Backgrou
ndColor":"#333333", "FontColor":"#FFFFF"
		}, ".svg-inline--fa":{ "color":"#fff" }, "UDChart":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".ud-navbar":{ "position":"fixed", "z-index":"9999", "width":"100%" }, ".collapsible
-body":{ "border-bottom":"1px solid #55b3ff", "background-color":"#252525" }, "li":{ "color":"#55b3ff" }, "ul:not(.browser-default)":{ "list-style-type":"none", "padding-left":"0", "background-color":"#1c1c1c" }, ".collapsible-header":{
			"border-bottom":
			"1px solid #55b3ff", "background-color":"#252525"
		}, ".pagination li.active":{ "background-color":"#55b3ff" }, ".tabs .tab":{ "color":"#252525" }, ".pagination li a":{ "color":"#fff !important" }, "[type=\"checkbox\"]:checked + span:not(.lever)::before
":{ "border-bottom":"2px solid #55b3ff", "border-right":"2px solid #55b3ff" }, "UDInput":{ "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".sidenav a:hover":{ "color":"#55b3ff", "background-color":"#1e353f" }, "UDNavBar":{ "BackgroundColor":"#1c1
c1c", "FontColor":"#55b3ff"
		}, ".collapsible":{ "margin":".5rem 0 1rem", "border-left":"1px solid #55b3ff", "border-right":"1px solid #55b3ff", "border-top":"1px solid #55b3ff" }, "img":{ "float":"left", "border-radius":"8px" }, "UDFooter":{
			"margin-top"
			:"4% !important", "BackgroundColor":"#1c1c1c", "FontColor":"#55b3ff"
		}, ".tabs .tab a":{ "color":"#FFFFFF" }, ".btn:hover":{ "background-color":"#55b3ff", "color":"#ffffff" }, "UDCard":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#
FFFFFF"
		}, "UDMonitor":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".btn-floating":{ "background-color":"#bababa", "color":"#1c1c1c" }, "h":{ "color":"#fff !important" }, ".tabs .indicator":{ "background-color":"#55b3ff
"
		}, ".tabs .tab a:focus.active":{ "color":"#55b3ff", "background-color":"#252525" }, ".select-dropdown li span":{ "color":"#ffffff" }, ".sidenav":{ "color":"#fff", "box-shadow":"none", "border-radius":"8px", "margin-top":"75px", "background-color":"#1c1
c1c", "z-index":"0", "height":"77%"
		}, "[type=\"radio\"]:checked + span::after":{ "background-color":"#55b3ff" }, ".btn":{ "color":"#1c1c1c", "background-color":"#bababa", "border-radius":"8px" }, ".tabs":{
			"color":"#55b3ff", "background-color":"#333333"
			 ,"margin-top":"64px", "z-index":"9998"
		}, "nav":{ "left":"0", "right":"0" }, "input:not([type]), input[type=\"date\"]:not(.browser-default), input[type=\"datetime-local\"]:not(.browser-default), input[type=\"datetime\"]:not(.browser-default), inpu
t[type=\"email\"]:not(.browser-default), input[type=\"number\"]:not(.browser-default), input[type=\"password\"]:not(.browser-default), input[type=\"search\"]:not(.browser-default), input[type=\"tel\"]:not(.browser-default), input[type=\"tex
		t\"]:not(.browser-default), input[type=\"time\"]:not(.browser-default), input[type=\"url\"]:not(.browser-default), textarea.materialize-textarea":{ "border-bottom":"1px solid #55b3ff", "color":"#FFFFFF" }, ".divider":{ "overflow":"hidden", "backg
round-color":"#55b3ff", "height":"1px"
		}
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Blue", "definition":{ "UDGrid":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDChart":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDCounter":{ "BackgroundColor":"#252525", "FontColor":"#FFF
FFF"
		}, "UDCard":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDFooter":{ "BackgroundColor":"#067DB2", "FontColor":"#55b3ff" }, "UDInput":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDDashboard":{ "BackgroundColor":"#333333", "Font
Color":"#FFFFF"
		}, "UDTable":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDMonitor":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDNavBar":{ "BackgroundColor":"#067DB2", "FontColor":"#55b3ff" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService {
	"name":"DarkDefault", "definition":{
		"UDGrid":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDChart":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDCounter":{ "BackgroundColor":"#272C33", "FontColor
":"#FFFFFF"
		}, "UDCard":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDTable":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDInput":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDDashboard":{
			"BackgroundColor":"#393F47"
			 ,"FontColor":"#FFFFFF"
		}, "UDFooter":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDMonitor":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDNavBar":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Default", "definition":{ "UDFooter":{ "BackgroundColor":"rgb(36, 81, 131)", "FontColor":"rgb(255, 255, 255)" }, "UDNavBar":{ "BackgroundColor":"rgb(36, 81, 131)", "FontColor":"rgb(255, 255, 255)" }, "UDDashboard
":{ "BackgroundColor":"rgb(255,255,255)", "FontColor":"rgb(0, 0, 0)" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService Rendering theme to CSS.
22:50:43 [Debug] ThemeService {
	"name":"Azure", "definition":{
		".modal":{ "background-color":"#a3a3a3", "color":"#000", "width":"90% !important", "max-height":"90% !important", "z-index":"9999 !important", "max-width":"90% !important" }, "UDCounter":{
			"border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF"
		}, "h3, h4":{ "color":"#fff", "line-height":"110%" }, ".select-wrapper input.select-dropdown":{ "color":"#ffffff", "border-block-end-color":"#55b3ff", "border-bottom":"1px soli
d #55b3ff"
		}, ".sidenav .subheader":{ "font-size":"18px", "color":"#fff" }, ".tabs .tab a.active":{ "color":"#55b3ff", "background-color":"#1c1c1c" }, "UDTable":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".dropdown-con
tent":{ "background-color":"#333333" }, ".card .card-action a:not(.btn):not(.btn-large):not(.btn-small):not(.btn-large):not(.btn-floating)":{ "color":"#55b3ff", "text-transform":"uppercase", "margin-right":"24px", "-webkit-transition":"color .3s e
ase", "transition":"color .3s ease"
		}, ".sidenav li > a":{ "font-size":"18px", "color":"#f1f1f1" }, ".sidenav .collapsible-header":{ "font-size":"18px", "color":"#fff !important", "background-color":"#1c1c1c !important" }, ".collection .collection-item
":{ "background-color":"#252525" }, ".tabs .tab a:hover":{ "color":"#55b3ff", "background-color":"#252525" }, "UDGrid":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".btn-flat":{ "color":"#fff" }, "UDDashboard":{ "Backgrou
ndColor":"#333333", "FontColor":"#FFFFF"
		}, ".svg-inline--fa":{ "color":"#fff" }, "UDChart":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".ud-navbar":{ "position":"fixed", "z-index":"9999", "width":"100%" }, ".collapsible
-body":{ "border-bottom":"1px solid #55b3ff", "background-color":"#252525" }, "li":{ "color":"#55b3ff" }, "ul:not(.browser-default)":{ "list-style-type":"none", "padding-left":"0", "background-color":"#1c1c1c" }, ".collapsible-header":{
			"border-bottom":
			"1px solid #55b3ff", "background-color":"#252525"
		}, ".pagination li.active":{ "background-color":"#55b3ff" }, ".tabs .tab":{ "color":"#252525" }, ".pagination li a":{ "color":"#fff !important" }, "[type=\"checkbox\"]:checked + span:not(.lever)::before
":{ "border-bottom":"2px solid #55b3ff", "border-right":"2px solid #55b3ff" }, "UDInput":{ "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".sidenav a:hover":{ "color":"#55b3ff", "background-color":"#1e353f" }, "UDNavBar":{ "BackgroundColor":"#1c1
c1c", "FontColor":"#55b3ff"
		}, ".collapsible":{ "margin":".5rem 0 1rem", "border-left":"1px solid #55b3ff", "border-right":"1px solid #55b3ff", "border-top":"1px solid #55b3ff" }, "img":{ "float":"left", "border-radius":"8px" }, "UDFooter":{
			"margin-top"
			:"4% !important", "BackgroundColor":"#1c1c1c", "FontColor":"#55b3ff"
		}, ".tabs .tab a":{ "color":"#FFFFFF" }, ".btn:hover":{ "background-color":"#55b3ff", "color":"#ffffff" }, "UDCard":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#
FFFFFF"
		}, "UDMonitor":{ "border-radius":"12px", "BackgroundColor":"#252525", "FontColor":"#FFFFFF" }, ".btn-floating":{ "background-color":"#bababa", "color":"#1c1c1c" }, "h":{ "color":"#fff !important" }, ".tabs .indicator":{ "background-color":"#55b3ff
"
		}, ".tabs .tab a:focus.active":{ "color":"#55b3ff", "background-color":"#252525" }, ".select-dropdown li span":{ "color":"#ffffff" }, ".sidenav":{ "color":"#fff", "box-shadow":"none", "border-radius":"8px", "margin-top":"75px", "background-color":"#1c1
c1c", "z-index":"0", "height":"77%"
		}, "[type=\"radio\"]:checked + span::after":{ "background-color":"#55b3ff" }, ".btn":{ "color":"#1c1c1c", "background-color":"#bababa", "border-radius":"8px" }, ".tabs":{
			"color":"#55b3ff", "background-color":"#333333"
			 ,"margin-top":"64px", "z-index":"9998"
		}, "nav":{ "left":"0", "right":"0" }, "input:not([type]), input[type=\"date\"]:not(.browser-default), input[type=\"datetime-local\"]:not(.browser-default), input[type=\"datetime\"]:not(.browser-default), inpu
t[type=\"email\"]:not(.browser-default), input[type=\"number\"]:not(.browser-default), input[type=\"password\"]:not(.browser-default), input[type=\"search\"]:not(.browser-default), input[type=\"tel\"]:not(.browser-default), input[type=\"tex
		t\"]:not(.browser-default), input[type=\"time\"]:not(.browser-default), input[type=\"url\"]:not(.browser-default), textarea.materialize-textarea":{ "border-bottom":"1px solid #55b3ff", "color":"#FFFFFF" }, ".divider":{ "overflow":"hidden", "backg
round-color":"#55b3ff", "height":"1px"
		}
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Blue", "definition":{ "UDGrid":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDChart":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDCounter":{ "BackgroundColor":"#252525", "FontColor":"#FFF
FFF"
		}, "UDCard":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDFooter":{ "BackgroundColor":"#067DB2", "FontColor":"#55b3ff" }, "UDInput":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDDashboard":{ "BackgroundColor":"#333333", "Font
Color":"#FFFFF"
		}, "UDTable":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDMonitor":{ "BackgroundColor":"#05608A", "FontColor":"#FFFFFF" }, "UDNavBar":{ "BackgroundColor":"#067DB2", "FontColor":"#55b3ff" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService {
	"name":"DarkDefault", "definition":{
		"UDGrid":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDChart":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDCounter":{ "BackgroundColor":"#272C33", "FontColor
":"#FFFFFF"
		}, "UDCard":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDTable":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDInput":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDDashboard":{
			"BackgroundColor":"#393F47"
			 ,"FontColor":"#FFFFFF"
		}, "UDFooter":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDMonitor":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }, "UDNavBar":{ "BackgroundColor":"#272C33", "FontColor":"#FFFFFF" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Default", "definition":{ "UDFooter":{ "BackgroundColor":"rgb(36, 81, 131)", "FontColor":"rgb(255, 255, 255)" }, "UDNavBar":{ "BackgroundColor":"rgb(36, 81, 131)", "FontColor":"rgb(255, 255, 255)" }, "UDDashboard
":{ "BackgroundColor":"rgb(255,255,255)", "FontColor":"rgb(0, 0, 0)" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Earth", "definition":{ "UDGrid":{ "BackgroundColor":"#6B4E04", "FontColor":"#FFFFFF" }, "UDChart":{ "BackgroundColor":"#6B4E04", "FontColor":"#FFFFFF" }, "UDCounter":{ "BackgroundColor":"#6B4E04", "FontColor":"#FF
FFFF"
		}, "UDCard":{ "BackgroundColor":"#6B4E04", "FontColor":"#FFFFFF" }, "UDFooter":{ "BackgroundColor":"#8A6505", "FontColor":"#55b3ff" }, "UDInput":{ "BackgroundColor":"#6B4E04", "FontColor":"#FFFFFF" }, "UDDashboard":{ "BackgroundColor":"#AB7D06", "Fon
tColor":"#FFFFF"
		}, "UDTable":{ "BackgroundColor":"#6B4E04", "FontColor":"#FFFFFF" }, "UDMonitor":{ "BackgroundColor":"#6B4E04", "FontColor":"#FFFFFF" }, "UDNavBar":{ "BackgroundColor":"#8A6505", "FontColor":"#55b3ff" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Green", "definition":{ "UDGrid":{ "BackgroundColor":"#70B24B", "FontColor":"#000000" }, "UDChart":{ "BackgroundColor":"#70B24B", "FontColor":"#000000" }, "UDCounter":{ "BackgroundColor":"#70B24B", "FontColor":"#00
0000"
		}, "UDCard":{ "BackgroundColor":"#70B24B", "FontColor":"#000000" }, "UDFooter":{ "BackgroundColor":"#72C220", "FontColor":"#000000" }, "UDInput":{ "BackgroundColor":"#70B24B", "FontColor":"#000000" }, "UDDashboard":{ "BackgroundColor":"#628C3C", "Fon
tColor":"#000000"
		}, "UDTable":{ "BackgroundColor":"#70B24B", "FontColor":"#000000" }, "UDMonitor":{ "BackgroundColor":"#70B24B", "FontColor":"#000000" }, "UDNavBar":{ "BackgroundColor":"#72C220", "FontColor":"#000000" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Red", "definition":{ "UDGrid":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFFFF" }, "UDChart":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFFFF" }, "UDCounter":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFF
FF"
		}, "UDCard":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFFFF" }, "UDFooter":{ "BackgroundColor":"#C2290F", "FontColor":"#55b3ff" }, "UDInput":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFFFF" }, "UDDashboard":{ "BackgroundColor":"#333333", "FontC
olor":"#FFFFF"
		}, "UDTable":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFFFF" }, "UDMonitor":{ "BackgroundColor":"#A1220C", "FontColor":"#FFFFFF" }, "UDNavBar":{ "BackgroundColor":"#C2290F", "FontColor":"#55b3ff" }
	}, "parent":""
}
22:50:43 [Debug] ThemeService { "name":"Test", "definition":{ "UDDashboard":{ "BackgroundColor":"#234234", "FontColor":"#959595" } }, "parent":"" }
22:50:43 [Debug] ThemeService Rendered theme content: .ud-footer {
	background-color : rgb(36, 81, 131);
	color : rgb(255, 255, 255);
}
.ud-navbar {
	background-color : rgb(36, 81, 131);
	color : rgb(255, 255, 255);
}
.ud-dashboard {
	background-color : rgb(255, 255, 255);
	color : rgb(0, 0, 0);
}

22:50:43 [Debug] NewDashboardCommand {
	"id":"00000000-0000-0000-0000-000000000000", "title":" IT Portal", "navBarColor":null, "navBarFontColor":null, "backgroundColor":null, "fontColor":null, "navbarLinks":null, "scripts":null, "stylesheets":nu
	ll, "pages":[{
		"type":"page", "name":"ServerInfo", "url":null, "defaultHomePage":false, "icon":"None", "components":[{
			"tag":"div", "attributes":{ "className":"row" }, "events":[], "type":"element", "key":"3b27e89a-4dc5-4ccf-9170-b415936633b5", "onMount":
			null, "id":"3eb980aa-f806-42b1-a32c-6eb2c145a951", "refreshInterval":5, "autoRefresh":false, "hasCallback":true
		}], "dynamic":false, "title":null, "id":"1619021c-e5d4-435b-9ab6-6594fe22d7e2", "refreshInterval":5, "autoRefresh":false, "hasCallback":fal
		se
	}], "cyclePages":false, "cyclePagesInterval":10, "error":null, "footer":null, "navBarLogo":null, "Demo":false, "geolocation":false, "filterText":null, "navigation":null, "frameworkAssetId":"index.5ecfc54d6719998eb49d.bundle.js"
}
22:50:43 [Debug] GetDashboardCommand Name:
22:50:43 [Debug] StopDashboardCommand ByServer
22:50:43 [Info] StartDashboardCommand  -  - False
22:50:43 [Debug] StartDashboardCommand {
	"id":"00000000-0000-0000-0000-000000000000", "title":" IT Portal", "navBarColor":null, "navBarFontColor":null, "backgroundColor":null, "fontColor":null, "navbarLinks":null, "scripts":null, "stylesheets":
	null, "pages":[{
		"type":"page", "name":"ServerInfo", "url":null, "defaultHomePage":false, "icon":"None", "components":[{ "tag":"div", "attributes":{ "className":"row" }, "events":[], "type":"element", "key":"d465cddb-5419-493c-a592-0afbe9f8c2e5", "onMount
":null, "id":"3eb980aa-f806-42b1-a32c-6eb2c145a951", "refreshInterval":5, "autoRefresh":false, "hasCallback":true
		}], "dynamic":false, "title":null, "id":"1619021c-e5d4-435b-9ab6-6594fe22d7e2", "refreshInterval":5, "autoRefresh":false, "hasCallback":f
		alse
	}], "cyclePages":false, "cyclePagesInterval":10, "error":null, "footer":null, "navBarLogo":null, "Demo":false, "geolocation":false, "filterText":null, "navigation":null, "frameworkAssetId":"index.5ecfc54d6719998eb49d.bundle.js"
}
22:50:43 [Debug] CustomAssemblyLoadContext Pointer Size:8
22:50:43 [Debug] CustomAssemblyLoadContext Loading files in native directory: C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard.Community\2.5.3\net472\runtimes\win-x64\native
22:50:43 [Debug] CustomAssemblyLoadContext Loading file: C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard.Community\2.5.3\net472\runtimes\win-x64\native\libuv.dll
22:50:43 [Debug] CustomAssemblyLoadContext Loading file: C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard.Community\2.5.3\net472\runtimes\win-x64\native\Microsoft.DiaSymReader.Native.amd64.dll
22:50:43 [Debug] ExecutionService ExecutionService constructor

Name        Port Running DashboardService
----        ---- ------- ----------------
Dashboard23   88    True UniversalDashboard.Services.DashboardService

Can you reload the page and then look in the log again? See if the error that you see on the screen is present in the log. If it is, I would need to see the stack trace for it. The stack trace shouldn’t include any sensitive info.

i think this should be the area o interest

23:09:57 [Info] Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker Executed action UniversalDashboard.Controllers.ComponentController.Element (UniversalDashboard) in 97.9403ms
23:09:57 [Debug] NewElementCommand HTML
23:09:57 [Debug] NewElementCommand { "tag":"td", "events":[], "content":["P0009"], "type":"element", "key":"8574c606-6996-4739-9a6e-7f4fc17b7eb9", "onMount":null, "id":"8f1c62d6-b7b6-4279-84c2-07433fee80cd", "refreshInterval":5, "autoRefresh":false, "hasCallback":false }
23:09:57 [Debug] NewElementCommand { "tag":"td", "events":[], "content":["488 GB"], "type":"element", "key":"dfaaeeb7-484b-42f0-9c48-285d554c8034", "onMount":null, "id":"967685cc-e886-4115-8fb5-61e6d774e168", "refreshInterval":5, "autoRefresh":false, "hasCallback":false }
23:09:57 [Warn] ExecutionService Error executing endpoint 425d3a7c-f44a-494f-bea9-2c2fa99f44a9. Collection was modified; enumeration operation may not execute.
at New-UDButton, C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard.Community\2.5.3\Modules\UniversalDashboard.Materialize\Scripts\button.ps1: line 28
at <ScriptBlock>, <No file>: line 7
23:09:57 [Debug] ComponentController ConvertToActionResult() { "Error":{ "message":"Collection was modified; enumeration operation may not execute.", "location":null, "type":"error", "id":null, "refreshInterval":0, "autoRefresh":false, "hasCallback":false } }
23:09:57 [Info] Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker Executed action method UniversalDashboard.Controllers.ComponentController.Element (UniversalDashboard), returned result Microsoft.AspNetCore.Mvc.JsonResult in 67.6304ms.
23:09:57 [Debug] NewElementCommand HTML
23:09:57 [Info] Microsoft.AspNetCore.Hosting.Internal.WebHost Request finished in 115.7572ms 200 application/json; charset=utf-8
23:09:57 [Debug] NewElementCommand HTML
23:09:57 [Info] Microsoft.AspNetCore.Hosting.Internal.WebHost Request starting HTTP/1.1 GET http://localhost:85/api/internal/component/element/f8476039-56f8-4c09-b580-d488af8dcaa8

Just having a real quick look your on 2.5.3 yeah? ANy chance you can upgrade to 2.6.0 and see if this is still present

will do that immediately

1 Like

Worth a shot. This might be a bug in UD. I’m not exactly sure what’s going on but it looks like the endpoint registration may be throwing this exception. Nothing is standing out to me in the code but I’ll try and reproduce.

Awesome to see it’s not just me who codes at silly o’clock…so there is something in that endpoint it doesnt like on the button…any chance you can put that endpoint code for the button?

If you say this happens on refresh is there something in that endpoint that takes a good few seconds to initialize then the page is loading before the endpoint? I will try and replicate the problem if I can from code posted. Thanks

Sorry I just seen your code at the top of the page…Doh! Ok so sometimes I get a weird error if Im calling from SQL and the page loads before the data is displayed in the table, then a refresh sorts this out…so

tested with 2.6.0 the same issue is there ,
and yes all the code is based on SQL invoke-sqlcmd and get-wmi… as it should manage remote servers is there is any way to tell the page to wait for all endpoints

just a side note , i can’t now get the UDLogging working after the upgrade from 2.5.3 to 2.6.0 i am using
Enable-UDLogging -FilePath C:\temp\log.txt
the log file is not created but the previous version was working fine.

sorry forgot to say that the same issue is happening randomly even while loading from CSVs

I’m suspecting a problem with UD. Can you tell me about how many buttons you have on that page that are using onClick?

Hello Adam,

did you get any updates.

@alaaelmahdy,

I have tested your posted code and could not re produce the issue except i have made a huge improvements that makes your code run a lot faster which i believe it will fix your issue as well

here is an example using $cache

    Get-UDDashboard | Stop-UDDashboard

    $Schedule = New-UDEndpointSchedule -Every 1 -Minute

    $ServiceCount = New-UDEndpoint -Schedule $Schedule -Endpoint {

    $Cache:ServicesCount = (Get-Service -ComputerName $Session:CurrentServerIP | where {
    			$_.StartType -eq "Automatic" -and $_.Status -eq "Stopped" }).count

    $Cache:Services = Get-Service -ComputerName $Session:CurrentServerIP | where {
    			$_.StartType -eq "Automatic" -and $_.Status -eq "Stopped"
    			 } | select "Name", "DisplayName", "Status"
    }


    $Dashboard = New-UDDashboard -Title "Inputs" -Content {
    New-UdColumn -Size 1.5 {
    New-UDCard -Title "Automatic Services" -TextSize Medium -Endpoint {
    							
    	$SVCTXT = "$Cache:ServicesCount Stopped Services"
    	New-UDButton -Text $SVCTXT -Icon stop_circle -IconAlignment left -OnClick {
    		Show-UDModal -Content {
    	New-UdGrid -Title "Automatic And Stopped Services" -NoPaging -NoFilter -NoExport -Headers @(
       "Name", "Display Name", "Status") -Properties @("Name", "DisplayName", "Status") -Endpoint {
    	$Cache:Services | Out-UDGridData
    			     }
    		      }
    	       }
         }
     }
  }

     Start-UDDashboard -Dashboard $Dashboard -Endpoint @($ServiceCount) -Port 1000  

in above example the page will load super fast and the services will be updated every 1 minute this way you are not calling get-service command more often.

also you can make it look little bit nicer like this

1 Like

I’ve also found an issue with UD that might be causing the initial issue. It’ll be in tonight’s nightly release if you want to give it a shot.

Dear Wael,
Thank you for your suggestion will rewrite the code your way and give it a try.
Thanks
Alaa Elmahdy

Dear Adam i updated to version 2.6.2 and still the same issue is there

image

It hasn’t been released to the gallery yet. You’ll need to install the nightly release: https://github.com/ironmansoftware/universal-dashboard/blob/master/tools/install-nightly.ps1