rider出现PluginException导致无法启动

发布于:2024-06-30 ⋅ 阅读:(56) ⋅ 点赞:(0)

目录

项目场景:

问题描述

原因分析:

解决方案:


项目场景:

由于deepinshot不适用于wayland,ubuntu自带的截图又难用的很,所以换了一款截图软件,叫flameshot,可支持在wayland上使用,虽然还是会有些问题,但还是值得去尝试一下;

事实证明,在ubuntu2404上面可以完美的适配wayland,而在ubuntu2204上还是会出现一些问题。

然后打算切换到x11上使用,不想再折腾了,毕竟太浪费时间了,切换之后,完美使用,但又迎来了一个更严重的问题,Rider不能使用了!


问题描述

启动过程中直接报错,点击确定直接关闭,无法启动!

然后根据提示参考了官网给出的网址,https://jb.gg/ide/critical-startup-errors

显然,很多人出现过类似的问题,官方根据大多数问题,整理归纳出来几类问题,并给出了答案:

问题1:“java.nio.file.AccessDeniedException:…plugins\github-copilot intellij\copilot agent\bin\copilot agent win.exe”,解决办法

问题2: "java.net.BindException: Address already in use: bind",解决办法

问题3:第三方插件造成的插件冲突,删除第三方插件目录;

显然我遇到的问题不在此列,只能另寻他发;百度了很久,没有找到相关的办法。

无奈,只能去翻系统日志了:

果然发现了问题,然后又翻出了rider的日志: 

Unhandled exception. System.TypeInitializationException: The type initializer for 'JetBrains.Util.PlatformUtil' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'JetBrains.HabitatDetector.Impl.Helper' threw an exception.
 ---> System.IO.FileNotFoundException: Could not find file '/etc/os-release'.
File name: '/etc/os-release'
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.OpenText(String path)
   at JetBrains.HabitatDetector.OsReleaseProperties.ReadFromDefaultLocations()
   at JetBrains.HabitatDetector.Impl.Unix.UnixHelper.GetOSName(JetPlatform platform, String unameSysname, String unameRelease)
   at JetBrains.HabitatDetector.Impl.Helper..cctor()
   --- End of inner exception stack trace ---
   at JetBrains.HabitatDetector.HabitatInfo.get_ClrImplementation()
   at JetBrains.Util.PlatformUtil.get_IsRunningOnCore()
   at JetBrains.Util.PlatformUtil..cctor()
   --- End of inner exception stack trace ---
   at JetBrains.Util.Concurrency.JetThreadApartment.STAThread()
   at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main()

还是日志靠谱!


原因分析:

至于原因,无从得知,但是该文件确实不存在了,可能是切换x11服务器的时候,出错,被误删了,翻了去换过程的日志,也没有找到答案,

 如果是这样,那应该不止rider出现问题,其他应用应该也会出现这样的问题:

 果然如此。


解决方案:

知道了问题,解决起来就简单了,重新生成一个就完了,当然需要注意得是,这种操作系统得文件需要用root来生成,需要root权限才能访问。

搞一个脚本,怼上去。

#!/bin/bash
echo "NAME=Ubuntu" > /etc/os-release
echo "VERSION=22.04 LTS (Jammy Jellyfish)" >> /etc/os-release
echo "ID=ubuntu" >> /etc/os-release
echo "ID_LIKE=debian" >> /etc/os-release
echo "PRETTY_NAME=\"Ubuntu 22.04 LTS\"" >> /etc/os-release
echo "VERSION_ID=22.04" >> /etc/os-release
echo "HOME_URL=https://www.ubuntu.com/" >> /etc/os-release
echo "SUPPORT_URL=https://help.ubuntu.com/" >> /etc/os-release
echo "BUG_REPORT_URL=https://bugs.launchpad.net/ubuntu/" >> /etc/os-release
echo "PRIVACY_POLICY_URL=https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" >> /etc/os-release
echo "VERSION_CODENAME=jammy" >> /etc/os-release
echo "UBUNTU_CODENAME=jammy" >> /etc/os-release

 切换到root下执行。


网站公告

今日签到

点亮在社区的每一天
去签到