Can't Start Photon Server

Hello everyone!

I'm having trouble starting Photon Server. I've followed the instructions found here. but whenever I select LoadBalancing(MyCloud) > Start as application the server tries to start and fails with the following exception:
System.TypeInitializationException: The type initializer for 'Photon.CounterPublisher.SystemCounter' threw an exception. ---> System.InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
   at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
   at System.Diagnostics.PerformanceCounterLib.get_NameTable()
   at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
   at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
   at ExitGames.Diagnostics.Counter.PerformanceCounterReader.Initialize() in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Counter\PerformanceCounterReader.cs:line 134
   at Photon.CounterPublisher.SystemCounter..cctor() in d:\dev\photon-socketserver-sdk_cloud\src-server\CounterPublisher\SystemCounter.cs:line 36
   --- End of inner exception stack trace ---
 at...
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Photon.CounterPublisher.SystemCounter' threw an exception. ---> System.InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
   at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
   at System.Diagnostics.PerformanceCounterLib.get_NameTable()
   at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
   at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
   at ExitGames.Diagnostics.Counter.PerformanceCounterReader.Initialize() in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Counter\PerformanceCounterReader.cs:line 134
   at Photon.CounterPublisher.SystemCounter..cctor() in d:\dev\photon-socketserver-sdk_cloud\src-server\CounterPublisher\SystemCounter.cs:line 36
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized)
   at System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj)
   at System.Reflection.RtFieldInfo.GetValue(Object obj)
   at ExitGames.Diagnostics.Monitoring.CounterSamplePublisherFactory.InitializeCounterPublisher(CounterSamplePublisher counterSamplePublisher, Object counterSet, IEnumerable`1 memberList, String counterSetName) in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Monitoring\CounterSamplePublisherFactory.cs:line 256
   at Photon.CounterPublisher.Application.Setup() in d:\dev\photon-socketserver-sdk_cloud\src-server\CounterPublisher\Application.cs:line 57
   at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning() in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 1189
   at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.PhotonRunning()
   at PhotonHostRuntime.PhotonDomainManager.PhotonRunning()
I'm trying to run the server on Windows 8.1 x64. Any help would be greatly appreciated.

Thanks

Comments

  • try solution from this reply. but you need to remember that you should use 64 bit version of lodctr - lodctr64

    best,
    ilya
  • Hi chvetsov. Thank you for a quick reply. I can't find the reply you're talking about. Did you forget to link it?
  • http://forum.photonengine.com/discussion/1741/loadbalancing-start-problem

    use search. this quiestion was asked few times on our forum

    best,
    ilya
  • Thanks again. I managed to resolve my issue. I've tried searching the forum and the web but I wasn't looking at the correct issue. I apologize for opening a new discussion.

    I made a simple mistake during installation of the server: I moved the extracted folder to a different location. I would suggest adding that notice to install instructions.

    Solution

    I removed the existing installation and extracted the server to the desired location: Don't move the extracted folder to a different location.

    I wasn't able to fix the perfmon counters from PerfMon Counter > Remove / Install Counters menu in the Photon Control. I used lodctr tool to restore the counters. The lodctr tool should be run from C:\Windows\SysWOW64 with administrator privileges with command lodctr /R.
  • Good to see you got this resolved with help of the forum, always makes us happy :)