locked
Code running on Azure VM reports exception as if it is running locally RRS feed

  • Question

  • User379720387 posted

    [ERR] [device2931]TMs.Core.Exceptions.BadPacketException: Data length reported incorrectly.
       at TMs.Core.Server.Packet.ValidateCommand() in C:\Users\Owner\source\Repos\TMs2020\TMs.Server\Packet.cs:line 143
       at TMs.Core.Server.Packet.LoadCommand(String packetStr) in C:\Users\Owner\source\Repos\TMs2020\TMs.Server\Packet.cs:line 160
       at TM.Core.Server.TcpSMClient.Parse(Byte[] buffer, Int32 read, Boolean identifiedClient) in C:\Users\Owner\source\Repos\TMs2020\TMs.Server\Client.cs:line 308 (6d38176b)

    This is happening here:

    if (dataLength != packetStr.Length)
                {
                    throw new BadPacketException("Data length reported incorrectly.");
                }

    public class BadPacketException : Exception
        {
            public BadPacketException(string message) : base(message)
            {
            }
        }

    Why is this reporting like this, and what is the remediation?

    Thursday, February 11, 2021 4:09 PM

All replies

  • User-474980206 posted

    you deployed a debug build to azure. the symbol file has the the file names of the source files used at build time. assuming you run the debugger on the machine that did the build, the  file names will be correct and the debugger can show the source code. 

    Thursday, February 11, 2021 4:20 PM
  • User379720387 posted

    Ok, deploy release build next time.

    Is there something I can do to the code to fix this as well, as it only does it with this exception, not anywhere else.

    Thursday, February 11, 2021 4:43 PM
  • User475983607 posted

    wavemaster

    s there something I can do to the code to fix this as well, as it only does it with this exception, not anywhere else.

    It looks like you wrote the if condition that fires the exception or maybe you are using source code from somewhere.  Try running your code through the debugger to find where the length is set and take a look at the value.  

    Thursday, February 11, 2021 4:48 PM