Last post Feb 11, 2021 04:48 PM by mgebhard
Feb 11, 2021 04:09 PM|wavemaster|LINK
[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?
Feb 11, 2021 04:20 PM|bruce (sqlwork.com)|LINK
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.
Feb 11, 2021 04:43 PM|wavemaster|LINK
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.
Feb 11, 2021 04:48 PM|mgebhard|LINK
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.