[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?
Click on "Mark as Answer" if my answers help you along.
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.
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.
Contributor
2611 Points
2711 Posts
Code running on Azure VM reports exception as if it is running locally
Feb 11, 2021 04:09 PM|wavemaster|LINK
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?
All-Star
58174 Points
15655 Posts
Re: Code running on Azure VM reports exception as if it is running locally
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.
Contributor
2611 Points
2711 Posts
Re: Code running on Azure VM reports exception as if it is running locally
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.
All-Star
53031 Points
23611 Posts
Re: Code running on Azure VM reports exception as if it is running locally
Feb 11, 2021 04:48 PM|mgebhard|LINK
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.