精华内容
下载资源
问答
  • .net core 下的PostgreSQL 异常排查—— Exception while reading from stream (0x80004005)
    千次阅读
    2021-11-17 19:48:54

    最近以PostgreSQL为存储介质,实现了分布式缓存的一个组件开发,在经过开发环境的测试后,顺利推送到产品组的手里,经过开发环境的验证后,终于发布到测试环境了,但问题来了,产品组反应频繁出现访问异常,返回的信息大致是:Exception while reading from stream … (0x80004005)

    • 📢欢迎点赞 :👍 收藏 ⭐留言 📝 如有错误敬请指正,赐人玫瑰,手留余香!
    • 📢本文作者:由webmote 原创,首发于 【CSDN】
    • 📢作者格言: 生活在于折腾,当你不折腾生活时,生活就开始折腾你,让我们一起加油!💪💪💪

    1. 缘起分布式缓存

    大家经常用的无非是Redis,Memcache,很少使用数据库做缓存吧?当然有些特殊场景,数据库也未必不能承担分布式缓存的功能,微软还实现了SQL Server的分布式缓存组件呢?不是吗?

    因此不要纠结为什么了!先收藏吧,长文不易,先收藏,后阅读!

    再次Review我的代码,基本的Get/Set操作均是使用Dapper.net进行sql操作,一条或者2条语句就实现了基本功能,使用using包括链接,也不存在链接的资源泄露,按理说,不应该出现异常。

    异常日志

    更多相关内容
  • 最近由于后端接口更改,请求验证码会抛异常,具体就是 image.fromstream(stream)函数里, using (var streamSub = new MemoryStream(imageStream)) { pictureBox_Captcha.Image = Image.FromStream(streamSub); }...

    1.问题

    最近由于后端接口更改,请求验证码会抛异常,具体就是 image.fromstream(stream)函数里,

    using (var streamSub = new MemoryStream(imageStream))
    {
        pictureBox_Captcha.Image = Image.FromStream(streamSub);
    }

    经调试,构造stream对象的字节流如下,

    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAIAAABVOSykAAAHqElEQVR42u2Ze0xbVRzHWVzm0GlcdDKjMcbX5h5Gg5Ax07CJkqibDnGTbRpnXDBsYzNumcOMjek2l73cRKd3tKUtrKzAnjAY8lpbaIG+KKVALYPxKFBepaWFFgrH3+3BUkpboMzMP3ryC9z7O+eee/nc3/md7+/ih3xt2s3Ph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I8NTfqIBQT/G6513XPOazfesLomDKP0N9d9DI0PI1GYTpXs9idLeNiWoBFJ/Jn/pnO8r2BhiDY9w9zxqvdmlbniYKjl1pxBlv4uo88nHAuFe9DnSCqf/8W+cV1jYwN9/309YpB4pJDfEGZU7oBXSDy8j9efhZS71Jy/1G+il7pzf3VLpesUhxG/vj+bdW56uXECXPp4sW5Gh3CtsUTsl9Zl/KSV5cbnjvNTq+wmL/GzWi6TH0PUQxFhIFtKXnieL6qpfpiikfc333x0frAfX/gF289bhNyWjXgAAAABJRU5ErkJggg=="

    然后采取了如下操作,

    直接将该字节流粘贴到浏览器地址栏(注意去掉开头和结尾的引号"")回车,会打开显示该字节流对应的图片,如下,

    搜索base64图片在线转换,如http://tool.chinaz.com/tools/imgtobase/,将字节流粘贴到base64位置,点击转为图片,依旧没问题~

    这就奇怪了,为什么 image.fromstream(stream)会抛异常?鼠标放到代码上按F1键弹出官方文档Image.FromStream Method,也没看出个所以然来,这该如何是好;

    2.解决思路

    其实上述已经在尝试解决了,验证数据有没有错误,看官方文档关于Image.FromStream Method的描述,然而还是没发现问题,那么该怎么办?请跟随博主继续探索,

    • 得到字节流后,粘贴到浏览器中(见上文)回车,将展示的图片邮件保存到本地,这样就是同样的图片;
    • 然后使用如下代码测试,
    using (var streamTest = new MemoryStream(pictureBytes))
    {
        string testPath = @"C:\test\下载.png";
        Image testImage = Image.FromFile(testPath);
    
        testImage.Save(streamTest, System.Drawing.Imaging.ImageFormat.Png);
        var TestArray = streamTest.ToArray();
        string strTest2 = Convert.ToBase64String(TestArray);
        string strTest = System.Text.Encoding.UTF8.GetString(TestArray);
    
        //  this is valid.
        var imageT1 = Image.FromStream(streamTest);
    
        //  this is valid too.
        Test(TestArray);
    
        //  as before showes, this is also valid.
        Test(Convert.FromBase64String(strTest2));
    }
    private void Test(byte[] value)
    {
        using (var streamSub = new MemoryStream(value))
        {
            Image image = Image.FromStream(streamSub);
        }
    }
    
    • 其中将字节流序列化到图片,再反序列化到内存中,用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VV2VsUEZVSFhYNmdZaG8vZWFyVG5OZlpUclNweXRqdWJuanBVNFEvMmtGb1huRXgxRUk4TlRmcUlCUVQvRzY1MTNYUE9hemZlc0xvbURLUDBOOWQ5REkwUEkxR1lUcFhzOWlkTGVOaVdvQkZKL0puL3BuTzhyMkJoaURZOXc5enhxdmRtbGJuaVlLamwxcHhCbHY0dW84OG5IQXVGZTlEblNDcWYvOFcrY1Yxall3TjkvMzA5WXBCNHBKRGZFR1pVN29CWFNEeThqOWVmaFpTNzFKeS8xRytpbDdwemYzVkxwZXNVaHhHL3ZqK2JkVzU2dVhFQ1hQcDRzVzVHaDNDdHNVVHNsOVpsL0tTVjVjYm5qdk5UcSt3bUwvR3pXaTZUSDBQVVF4RmhJRnRLWG5pZUw2cXBmcGlpa2ZjMzMzeDBmckFmWC9nRjI4OWJoTnlXalhnQUFBQUJKUlU1RXJrSmdnZz09In0="

    和原字节流对比,看出什么了没?少了开头的子字符串:"data:image/png;base64,",并且后续的子字符串也不完全一样,如果在strTest2前加上"data:image/png;base64,",然后放到浏览器或者在线转图片转出来的图片效果和上面的完全一样,

    而上述代码中的

    string strTest2 = Convert.ToBase64String(TestArray);
    string strTest = System.Text.Encoding.UTF8.GetString(TestArray);

    两语句同样是调用Image.FromStream()为什么就没问题了呢?

    因为这两句都是仅图片对应的base64字符串转为二进制字节流(原始字节流,非base64)后再调用Image.FromStream()接口的,

    到这里就基本发现问题了,应该将获取到的字节流(包含已base64编码后的图片字节流)中的base64图片字节流提取出来,再还原为原始的字节流后调用接口,

    byte[] imageStream = Convert.FromBase64String(GetImageBase64(capData.captchaImage));
    using (var streamSub = new MemoryStream(imageStream))
    {
        picBox.Image = Image.FromStream(streamSub);
    }
    private string GetImageBase64(string strContent)
    {
        string[] strSubs = strContent.Split(':', ';', ',');
        return strSubs[strSubs.Length - 1];
    }

    问题解决~

    3.总结

    经初步验证问题后,不一定会定位到具体问题所在,如果没有定位到,不妨创建一种肯定不会出错的场景(比如本文中,由原始图片文件反序列化到字节流,再调用接口转为image对象),得到没有问题的场景下的数据,然后与此前有问题的数据进行对比,这样更直观、准确和容易的分析出问题原因,然后去解决。

    递推,归纳法亦是如此。

     

    展开全文
  • 运行到 Image downImage = Image.FromStream(imgRequest.GetResponse().GetResponseStream());就报错参数无效,查不到原因我是醉了 请教大佬 public void ImgSave(string url, string wzname, string tpname) { ...
  • # 将数据流转成图片时报错,内存不足,... System.Drawing.Image imgData = Image.FromStream(stream1);//报错内存不足 imgData.Save(urlData, System.Drawing.Imaging.ImageFormat.Png);//xxx.jpeg为文件名 ```
  • image = Image.FromStream(ms, true); image.Save(toFile); base64如下: SuZTUzIxAAADpagECAUHCc7QAAAjpHYBAAAAg0gbt6XLAMcMiQBlAEeooQD5APEPLACRpb4PRwCRAAkPEaSmAMsNMgAjALCq0wA7...
  • 框架:.Net Framewrok 4.7.2 ... PictureBox1.Image = Bitmap.FromStream(ms) 'memoryStream → PictureBox.Image buff = Nothing fs.Close() '关闭文件占用 ms.Close() '关闭内存流,释放内存 End Sub

    框架:.Net Framewrok 4.7.2

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            PictureBox1.AllowDrop = True
    End Sub
    
    Private Sub PictureBox1_DragEnter(sender As Object, e As DragEventArgs) Handles PictureBox1.DragEnter
            If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
                e.Effect = DragDropEffects.Link
            Else
                e.Effect = DragDropEffects.None
            End If
     End Sub
     
    Private Sub PictureBox1_DragDrop(sender As Object, e As DragEventArgs) Handles PictureBox1.DragDrop
            Dim files() As String
            files = e.Data.GetData(DataFormats.FileDrop)
            If files.Length > 1 Then MsgBox("请只放入一个文件") : Exit Sub
            Debug.Print(files(0))
            PictureBox1.Image = Image.FromFile(files(0)) 
            'image.FromFile和bitmap.FromFile都会导致该文件的占用
            '比较建议用fileIO把图片加载到buff里去,可以不导致占用
             '===============存储照片=====================
            PictureBox1.Image.Save(Application.StartupPath & "\01.txt", Imaging.ImageFormat.MemoryBmp)
            '这里的ImageFormat必须是MemoryBmp,不然会导致Bitmap From Stream的参数错误
        End Sub
        
        Private Sub BT读取图片_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim fs As New IO.FileStream(Application.StartupPath & "\01.txt", IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
            Dim buff(fs.Length) As Byte
            Dim byts As Byte
            
            For Each byts In buff    '初始化buff
                byts = 0
            Next
            
    	fs.Read(buff, 0, fs.Length)    		    ' fileStream → buff
            Dim ms As New IO.MemoryStream(buff)    	    'buff → memoryStream
            PictureBox1.Image = Bitmap.FromStream(ms)   'memoryStream → PictureBox.Image
            buff = Nothing
            fs.Close()    '关闭文件占用
            ms.Close()    '关闭内存流,释放内存
        End Sub
    
    展开全文
  • Image.FromStream(ms) 提示参数无效

    千次阅读 2018-05-29 16:33:00
    说明ms有问题,首先确保有读到数据,这种情况是保存到库的时候出错的。 原来你可能是这样写的: MemoryStream stream = new ... //这里出错,原图片格式是JPEGbyte [] bytestream = new byte [ stream.Leng...

    说明ms有问题,首先确保有读到数据,这种情况是保存到库的时候出错的。

    原来你可能是这样写的:

    MemoryStream stream = new MemoryStream();
    PictureBox1.Image.Save(stream, ImageFormat.Bmp ); //这里出错,原图片格式是JPEG
    byte [] bytestream = new byte [ stream.Length ];
    stream .Read (bytestream ,0,bytestream .Length );
    stream.Flush();

    应该为:

    MemoryStream stream = new MemoryStream();
    PictureBox1.Image.Save(stream,PictureBox1 .Image .RawFormat );
    byte[] bytestream = stream.ToArray();
    stream.Flush();

    转载于:https://www.cnblogs.com/dachuang/p/9105762.html

    展开全文
  • 关于FromStream()argumentException 参数无效异常. 为了将一个二维字节数组byte[] 转换为image类型的图片 最初我写了以下代码。 Bitmap btm = new Bitmap(pictureBox1.ImageLocation);   byte [] tt=imgproc....
  • 我再用Image.FromStream 转成Image时因为数据过大,导致报错:内存不足。然后网上搜了很多方法也没什么用。先看我以前的代码吧//解析json串 JObject JsonTrackData = (JObject)JsonConvert.DeserializeObject(Track...
  • .\stm32_freertos.axf: Error: L6218E: Undefined symbol xTaskGetCurrentTaskHandle (referred from stream_buffer.o) 解决方法是在官方提供的FreeRTOS.h文件中 #ifndef INCLUDE_xTaskGetCurrentTaskHandle #...
  • Image.FromStream与Image.FromFile使用区别

    千次阅读 2017-04-06 19:20:43
    将一个图片加载并显示在picturebox上,一般情况下得到预期的结果,然而对于同一个filepath,若连续两次调用下面的语句系统将会报错(如用户多次选择加载同一张图片使用Image.FromFile配合PictureBox来加载并显示图片...
  • Image *image = Image::FromStream(pStmBmp); CClientDC dc(this); Graphics graphics(dc.m_hDC);//通过设备描述表句柄实例化一个 gdi+ Graphics 类成员 graphics.DrawImage(image,0,0);
  • .\stm32_freertos.axf: Error: L6218E: Undefined symbol xTaskGetCurrentTaskHandle (referred from stream_buffer.o). 解决方法是在官方提供的FreeRTOS.h文件中 #ifndef INCLUDE_xTaskGetSchedulerState #define...
  • Image img = Image.FromStream(ms); this.pictureBox1.Image = img; }     我的写数据 private void btnOK_Click(object sender, EventArgs e) { string name = ""; if (tbxUserName.Text....
  • Gdiplus::Bitmap::FromStream 加载资源失败

    千次阅读 2015-05-28 14:33:20
     1、DLL中切换资源 AFX_MANAGE_STATE(AfxGetStaticModuleState()); 2、初始化进程实例的时候启动GDI+  Gdiplus::GdiplusStartupInput gdiplusStartupInput;  Gdiplus::GdiplusStartup(&m_gdiplusToken, &...
  • 今天我在导入一份CheckStyle文件的时候出现了如下错误(如图):unable to read from stream  我在对比了其他正确的ChechStyle文件之后,发现这个无法导入的文件的编码和正确文件的编码不一样,我的xml文档编码...
  • Image.FromStream与Image.FromFile

    千次阅读 2012-12-14 16:30:33
    在使用vs进行开发时,我们有时会使用Image.FromFile配合PictureBox来加载并显示图片,感觉挺方便,但是使用Image.FromFile有个小问题,加载完文件后不自动释放,导致再次操作被关联文件时候出现类似“文件xxx正由另...
  • CheckStyle unable to read from stream

    千次阅读 2013-10-14 11:35:55
    今天我在导入一份CheckStyle文件的时候出现了如下错误(如图):unable to read from stream  我在对比了其他正确的ChechStyle文件之后,发现这个无法导入的文件的编码和正确文件的编码不一样,我的xml文档编码...
  • Image::FromStream(pStream) 返回0

    千次阅读 2013-03-14 22:17:25
    今天在做GDI,PNG的...pImage=Gdiplus::Image::FromStream(pStream);总是返回0; 原来是没有初始化GDI Gdiplus::GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; //初始化GDI+.
  • 将图片存入数据库时,读取图片并显示时出现“参数无效”问题,检查代码没问题啊。 经过各大搜索无数据的搜索,终于有人提出了解决问题的办法,原来不在读,在写时就埋下了种子: new SqlParameter("@img",...
  • “Authentication to host ‘localhost’ for user ‘root’ using method ‘mysql_native_password’ failed with message: Reading from the stream has failed” 昨天晚上,因为某些原因,几天没打开的C#.net ...
  • Image::FromStream(pIStream)返回空

    千次阅读 2012-07-10 21:34:20
    m_pImage=Image::FromStream(pIStream); 这里。原来是Image::FromStream(pIStream)返回了空内容。仔细查看别人的工程代码,发现原来在移植到自己的工程中漏了App中的代码。于是将 GdiplusStartupInput ...
  • Authentication to host ‘xxxx’ for user ‘yyyy’ using method ‘mysql_native_password’ failed with message: Reading from the stream has failed. 表现特征:     1.只有用Connector/NET 出现这个...
  • 昨天遇到sql读写图片时Image.FromStream方法老提示参数错误,搞了好久,今天终于找到原因,解决了。 #region 图片Image与byte[]数组互转 /// /// ImageToBytes,默认为Jpeg格式 /// /// /// public static byte[]...
  • 在序列化与反序列化中,我们经常使用CComVariant.ReadFromStream从一个数据流中读取变量。常规的代码如下:HRESULT __PIMShell_AjaxList_Load(IStream* pStream){...CComVariant vValue=(bool)true;...HRESULT hr=...
  • MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host '172.16.0.203' for user '******' using method 'mysql_native_password' failed with message: Reading from the stream has failed...
  • FATAL: could not receive data from WAL stream 这表示备用服务器上的流复制的接收进程已经终止,因为它无法从到主服务器的连接中再传输任何更改。 问题原因 通常,当主节点服务器和备用节点服务器之间出现网络...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 316,898
精华内容 126,759
关键字:

fromstream

友情链接: SHIYAN3.zip