Server not starting

thedragon7ell
edited December 2021 in Photon Server

I can't run any server instance from the Photon Control every time I run the server application it show that log


8984: 01:22:29.459 - Service: "Photon Socket Server" starting

8984: 01:22:29.459 - Config File: D:\Photon\deploy\bin_Win64\PhotonServer.config

8984: 01:22:29.459 - Will produce at most: 10 crash dumps

8984: 01:22:29.459 - Construction of service object complete

8984: 01:22:29.459 - Server Starting...

8984: 01:22:29.459 -  Tick count: 29948640 (wraps in: 49.3636 days)

8984: 01:22:29.459 - Tick count 64: 29948640

8984: 01:22:29.459 - ENet high resolution Tick count: 29948816 (wraps in: 49.3636 days)

8984: 01:22:29.459 - Photon Version: 5.0.12.7770

8984: 01:22:29.459 - Photon Build: RELEASE - x64 - VS2019 (16.8) - 192829336

8984: 01:22:29.459 - PID: 12728

8984: 01:22:29.459 - EXE: D:\Photon\deploy\bin_Win64\PhotonSocketServer.exe

8984: 01:22:29.459 - OpenSSL 1.1.1i 8 Dec 2020

8984: 01:22:29.459 - Config File: D:\Photon\deploy\bin_Win64\PhotonServer.config

8984: 01:22:29.459 - CService::OnException() - Exception: CXMLConfiguration::LoadDocument() - Failed to locate required initial child element: "Instance" - Source: "D:\Photon\deploy\bin_Win64\PhotonServer.config"

8984: 01:22:29.459 - Server shutting down...

8984: 01:22:29.459 - Shutting down socket servers...

8984: 01:22:29.459 - Waiting for socket servers to shutdown...

8984: 01:22:29.459 - Destroying servers

8984: 01:22:29.459 - Destroying WebRTC Outbound Connection Manager

8984: 01:22:29.459 - Destroying WebRTC Outbound Host

8984: 01:22:29.459 - Destroying outbound ICE connection manager

8984: 01:22:29.459 - Destroying ENet timer wheel

8984: 01:22:29.459 - Destroying Network Data Trace factory

8984: 01:22:29.459 - Destroying ENet host

8984: 01:22:29.459 - Destroying WebRTC inactivity timer queue

8984: 01:22:29.459 - Destroying WebRTC host

8984: 01:22:29.459 - Destroying ICE connection manager

8984: 01:22:29.459 - Destroying TCP inactivity timer

8984: 01:22:29.459 - Destroying CLR applications

8984: 01:22:29.459 - Destroying ENet thread pool

8984: 01:22:29.459 - Destroying I/O thread pool

8984: 01:22:29.459 - Destroying HTTP File Server I/O thread pool

8984: 01:22:29.459 - Destroying ENet I/O thread pool

8984: 01:22:29.459 - Destroying ENet buffer allocator

8984: 01:22:29.459 - Destroying TCP buffer allocator

8984: 01:22:29.459 - Destroying TCP socket allocator

8984: 01:22:29.459 - Destroying NEW TCP socket allocator

8984: 01:22:29.459 - Destroying NEW TCP configuration

8984: 01:22:29.459 - Destroying UDP Chunk inbound socket allocator

8984: 01:22:29.459 - Destroying shared datagram flow control data

8984: 01:22:29.459 - Shutdown complete...

8984: 01:22:29.459 - Service shutting down: with Exception (1). Errorcode: 6

8984: 01:22:29.474 - Service shut down complete

Best Answer

  • chvetsov
    chvetsov mod
    Accepted Answer

    hi, @thedragon7ell

    you are using broken PhotonServer.config. after configuration node you should see Instance node like here:

    <Configuration>
      <!-- Multiple instances are supported. Each instance has its own node in the config file. -->
    
    
      <Instance Name="LoadBalancing"
        MaxMessageSize="512000"
        MaxQueuedDataPerPeer="512000"
    

    best,

    ilya

Answers

  • chvetsov
    chvetsov mod
    Accepted Answer

    hi, @thedragon7ell

    you are using broken PhotonServer.config. after configuration node you should see Instance node like here:

    <Configuration>
      <!-- Multiple instances are supported. Each instance has its own node in the config file. -->
    
    
      <Instance Name="LoadBalancing"
        MaxMessageSize="512000"
        MaxQueuedDataPerPeer="512000"
    

    best,

    ilya

  • thedragon7ell
    edited December 2021

    It worked just fine I was doing this

      <LoadBalancing
        MaxMessageSize="512000"
        MaxQueuedDataPerPeer="512000"
    
    but I now I have other problem 
    

    Failed to start application in AppDomain: 2 - Constructor on type 'Photon_Framework.PhotonApplication' not found

    and I am sure I set the type and Assembly to the values in my project
    


  • @thedragon7ell please recheck everything. probably path is wrong. may be type is not public

    From what you provide I can only guess

    best,

    ilya

  • @chvetsov Thank you for the fast replay I am super delighted with the service

    I rechecked the path  and her is the files


  • @thedragon7ell you have to issues:

    • we use .netframework 4.6.1. you potentially may have issues because you use 4.8. first get it working with 4.6.1 and than switch to 4.8 to see whether it works as expected.
    • we put our binaries to 'bin' folder. and look for them in 'bin' folder. look at LoadBalancing. you'll see

    best,

    ilya

  • thedragon7ell
    edited December 2021

    @chvetsov I moved the files to bin folder inside the server folder and switch the net framework to 4.6.1

    But it didn't seem to fix the issue

    that is the log file for the operation I hope you can help with it

  • hi, @thedragon7ell

    it looks like type name (namespace) is incorrect


    best,

    ilya

  • thedragon7ell
    edited December 2021

    hi @chvetsov

    I changed the name space of the project from photon_Network to photonNetwork in the project sittings in the code and in the config file, is that what you mean by that or what?

  • @thedragon7ell it should be spelled correctly. It should be same in both cases. from what you shared I assumed that it is misspelled.

    also your 'PhotonApplication' class should have public default constructor

    best,

    ilya

  • thedragon7ell
    edited December 2021

    @chvetsov

    It spelled correctly and the class have public default constructor


  • JohnTube
    JohnTube mod
    edited December 2021

    Hi @thedragon7ell,

    Thank you for choosing Photon!

    How do you start the server? As an application from PhotonControl or as a service?

    I see a little problem in PhotonServer.config (maybe share this file with us?):

      <Applications Default="TestServer">
       <Application
        Name="PhotonApplication"
        BaseDirectory="TestServer"
        Assembly="PhotonFramework"
        Type="PhotonFramework.PhotonApplication">
       </Application>
    

    I would change it like this:

      <Applications Default="TestServer">
       <Application
        Name="TestServer"
        BaseDirectory="TestServer"
        Assembly="PhotonFramework"
        Type="PhotonFramework.PhotonApplication">
       </Application>
    

    or

      <Applications Default="PhotonApplication">
       <Application
        Name="PhotonApplication"
        BaseDirectory="TestServer"
        Assembly="PhotonFramework"
        Type="PhotonFramework.PhotonApplication">
       </Application>
    


  • Hi @JohnTube

    I know about this and I changed it for debugging and found changing the name only changes the name in log file.

    Any way make as you suggested will not fix the problem.

    Is it possible that some one can list for me the reasons why that error may show 🙂

  • hi, @thedragon7ell

    yes, your constructor is public. is it default?


    best,

    ilya

  • Hi @chvetsov

    as far as I now the default constructor is the constructor with no parameters and that can't be made because the base constructor must have Iconfiguration as Input. How do you think I should implement the default constructor??

  • hi, @thedragon7ell

    we have sdk with sample. Please check there

    best,

    ilya