You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone, as Title said I am getting DataCenterMigrationException after downloading any File or Photo
here is my code for downloading Photo:
` var photo = (((TLMessageMediaPhoto)((TLMessage)message).Media).Photo as TLPhoto);
// get photo
TLPhotoSize photoSize = photo.Sizes.ToList().OfType().Last();
var mb = 1048576;
var upperLimit = (int)Math.Pow(2, Math.Ceiling(Math.Log(photoSize.Size, 2))) * 4;
var limit = Math.Min(mb, upperLimit);
var currentOffset = 0;
var fileLocation = new TLInputPhotoFileLocation()
{
AccessHash = photo.AccessHash,
Id = photo.Id,
FileReference = photo.FileReference,
ThumbSize = photoSize.Type,
};
using (var fs = File.OpenWrite("TestFile.jpg"))
{
while (currentOffset < photoSize.Size)
{
var file = this.TelegramClient.GetFile(fileLocation, limit, currentOffset).ConfigureAwait(false).GetAwaiter().GetResult();
fs.Write(file.Bytes, 0, file.Bytes.Length);
currentOffset += file.Bytes.Length;
Thread.Sleep(500);
}
fs.Close();
}`
so when I am trying to get another message or call any other Method I am getting this Exception and in Output i can see those lines:
"TgSharp.Core.Network.Exceptions.UserMigrationException" in mscorlib.dll
"TgSharp.Core.Network.Exceptions.UserMigrationException" in TgSharp.Core.dll
"TgSharp.Core.Network.Exceptions.UserMigrationException" in mscorlib.dll
"TgSharp.Core.Network.Exceptions.UserMigrationException" in TgSharp.Core.dll
...
Anyone knows how to handle this problem?
The text was updated successfully, but these errors were encountered:
@pahager Seems like you terminated the application when the auth was migrated to another DataCenter. This migrated auth was stored in the Session and now it cannot be used to establish the connection. Try to delete session.dat and perform a new authentication.
Hello everyone, as Title said I am getting DataCenterMigrationException after downloading any File or Photo
here is my code for downloading Photo:
` var photo = (((TLMessageMediaPhoto)((TLMessage)message).Media).Photo as TLPhoto);
// get photo
TLPhotoSize photoSize = photo.Sizes.ToList().OfType().Last();
so when I am trying to get another message or call any other Method I am getting this Exception and in Output i can see those lines:
"TgSharp.Core.Network.Exceptions.UserMigrationException" in mscorlib.dll
"TgSharp.Core.Network.Exceptions.UserMigrationException" in TgSharp.Core.dll
"TgSharp.Core.Network.Exceptions.UserMigrationException" in mscorlib.dll
"TgSharp.Core.Network.Exceptions.UserMigrationException" in TgSharp.Core.dll
...
Anyone knows how to handle this problem?
The text was updated successfully, but these errors were encountered: