FS#72258 - [pycharm-community-edition] 2021.2.2-1 markdown preview broken

Attached to Project: Community Packages
Opened by Brandon (hashstat) - Monday, 27 September 2021, 23:19 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:02 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Leonidas Spyropoulos (inglor)
Levente Polyak (anthraxx)
Orhun Parmaksız (orhun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:

The Markdown plugin preview panel is not shown for markdown files in the latest version of PyCharm. Viewing Settings -> Languages & Frameworks -> Markdown displays the message "There are no available preview providers."

Googling the issue resulted in pages suggesting installing the already-installed java11-openjfx package.

I was able get the preview panel to display with the bundled Java runtime (JBR) using the following steps:
1. Download the package from the PyCharm download site
2. Extract the jbr directory from the tarball
3. Run pycharm with the PYCHARM_JDK environment variable set to the full path of the extracted jbr directory: `env PYCHARM_JDK=/full/path/to/jbr pycharm`

Because of my success with the bundled runtime, I'm not sure if this is a java runtime (java11-openjfx) issue or an issue with the pycharm-community-edition package.


Package versions:
* java11-openjfx 11.0.10.u1-1
* jdk11-openjdk 11.0.12.u7-1
* jre11-openjdk 11.0.12.u7-1
* jre11-openjdk-headless 11.0.12.u7-1
* pycharm-community-edition 2021.2.2-1


Log output:

There isn't much of anything helpful in the log, except maybe for the last line included in the partial idea.log below. No errors or stack traces.
```
2021-09-27 16:03:57,754 [ 0] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
2021-09-27 16:03:57,855 [ 101] INFO - #com.intellij.idea.Main - IDE: PyCharm (build #PC-212.5284.44, 15 Sep 2021 12:45)
2021-09-27 16:03:57,857 [ 103] INFO - #com.intellij.idea.Main - OS: Linux (5.14.8-arch1-1, amd64)
2021-09-27 16:03:57,868 [ 114] INFO - #com.intellij.idea.Main - JRE: 11.0.12+7 (Oracle Corporation)
2021-09-27 16:03:57,868 [ 114] INFO - #com.intellij.idea.Main - JVM: 11.0.12+7 (OpenJDK 64-Bit Server VM)
2021-09-27 16:03:57,870 [ 116] INFO - #com.intellij.idea.Main - JVM Args: -Xms128m -Xmx2048m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -XX:ErrorFile=/home/brandon/java_error_in_pycharm_%p.log -XX:HeapDumpPath=/home/brandon/java_error_in_pycharm_.hprof -Djb.vmOptionsFile=/home/brandon/.config/JetBrains/PyCharmCE2021.2/pycharm64.vmoptions -Djava.system.class.loader=com.intellij.util.lang.PathClassLoader -Didea.vendor.name=JetBrains -Didea.paths.selector=PyCharmCE2021.2 -Didea.platform.prefix=PyCharmCore -Dsplash=true
2021-09-27 16:03:57,870 [ 116] INFO - #com.intellij.idea.Main - library path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
2021-09-27 16:03:57,870 [ 116] INFO - #com.intellij.idea.Main - boot library path: /usr/lib/jvm/java-11-openjdk/lib
2021-09-27 16:03:57,892 [ 138] INFO - #com.intellij.idea.Main - locale=en_US JNU=UTF-8 file.encoding=UTF-8
idea.config.path=/home/brandon/.config/JetBrains/PyCharmCE2021.2
idea.system.path=/home/brandon/.cache/JetBrains/PyCharmCE2021.2
idea.plugins.path=/home/brandon/.local/share/JetBrains/PyCharmCE2021.2
idea.log.path=/home/brandon/.cache/JetBrains/PyCharmCE2021.2/log
2021-09-27 16:03:57,902 [ 148] INFO - #com.intellij.idea.Main - CPU cores: 8; ForkJoinPool.commonPool: java.util.concurrent.ForkJoinPool@76fe856[Running, parallelism = 7, size = 7, active = 3, running = 3, steals = 3, tasks = 0, submissions = 0]; factory: com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory@5a58c403
2021-09-27 16:03:57,923 [ 169] INFO - #com.intellij.idea.Main - JNA library (64-bit) loaded in 21 ms
2021-09-27 16:03:58,000 [ 246] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: IDEA CORE (212.5284.44), EditorConfig (212.5284.44), Machine Learning Code Completion (212.5284.44), Mercurial (212.5284.44), ReStructuredText (212.5284.44), Subversion (212.5284.44), Configuration Script (212.5284.44), IntelliLang (212.5284.44), Settings Repository (212.5284.44), Terminal (212.5284.44), Emoji Picker (212.5284.44), Task Management (212.5284.44), TextMate Bundles (212.5284.44), Copyright (212.5284.44), Shell Script (212.5284.44), Images (212.5284.44), Markdown (212.5284.44), Properties (212.5284.44), IDE Features Trainer (212.5284.44), Git (212.5284.44), IDE Features Trainer: Git Lessons (212.5284.44), ChangeReminder (212.5284.44), YAML (212.5284.44), Grazie (212.5284.44), Python Community Edition (212.5284.44), PyCharm Community Customization (212.5284.44), GitHub (212.5284.44)
2021-09-27 16:03:58,001 [ 247] INFO - llij.ide.plugins.PluginManager - Loaded custom plugins: IdeaVim (1.7.1), Ini (212.4746.57), Toml (0.2.155.4114-212), String Manipulation (8.15.203.000.3), CSV (2.17.1)
2021-09-27 16:03:58,689 [ 935] INFO - om.intellij.ui.scale.JBUIScale - System scale factor: 1.0 (IDE-managed HiDPI)
2021-09-27 16:03:58,943 [ 1189] INFO - #com.intellij.idea.Main - WM detected: GNOME Shell
2021-09-27 16:03:58,964 [ 1210] WARN - ntellij.ui.svg.SvgCacheManager - Icon cache will be recreated or previous version of data reused, (db=/home/brandon/.cache/JetBrains/PyCharmCE2021.2/icons-v3.db)
2021-09-27 16:03:59,079 [ 1325] INFO - ication.options.PathMacrosImpl - Loaded path macros: {}
2021-09-27 16:03:59,169 [ 1415] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342
2021-09-27 16:03:59,231 [ 1477] WARN - tor.impl.FontFamilyServiceImpl - Couldn't access required runtime API, will fall back to basic logic of font selection
2021-09-27 16:03:59,405 [ 1651] INFO - intellij.util.io.FilePageCache - lower=100; upper=500; buffer=10; max=1961
2021-09-27 16:03:59,511 [ 1757] INFO - til.net.ssl.CertificateManager - Default SSL context initialized
2021-09-27 16:03:59,778 [ 2024] WARN - nSystem.impl.ActionManagerImpl - keymap "Visual Studio" not found [Plugin: com.intellij]
2021-09-27 16:03:59,781 [ 2027] WARN - nSystem.impl.ActionManagerImpl - keymap "Eclipse" not found [Plugin: com.intellij]
2021-09-27 16:03:59,782 [ 2028] WARN - nSystem.impl.ActionManagerImpl - keymap "NetBeans 6.5" not found [Plugin: com.intellij]
2021-09-27 16:03:59,782 [ 2028] WARN - nSystem.impl.ActionManagerImpl - keymap "Visual Studio" not found [Plugin: com.intellij]
2021-09-27 16:03:59,847 [ 2093] WARN - tellij.ide.SystemHealthMonitor - issue detected: bundled.jre.version.message (ignored)
2021-09-27 16:03:59,954 [ 2200] WARN - nSystem.impl.ActionManagerImpl - keymap "Eclipse" not found [Plugin: PythonCore]
2021-09-27 16:03:59,954 [ 2200] WARN - nSystem.impl.ActionManagerImpl - keymap "NetBeans 6.5" not found [Plugin: PythonCore]
2021-09-27 16:03:59,962 [ 2208] WARN - nSystem.impl.ActionManagerImpl - keymap "Eclipse" not found [Plugin: org.jetbrains.plugins.github]
2021-09-27 16:03:59,980 [ 2226] INFO - leBasedIndexDataInitialization - Index data initialization done: 290 ms. Initialized indexes: [FilenameIndex, FrameworkDetectionIndex, TodoIndex, IdIndex, filetypes, Stubs, Trigram.Index, fileIncludes, DomFileIndex, RelaxSymbolIndex, XmlTagNames, XmlNamespaces, html5.custom.attributes.index, SchemaTypeInheritance, json.file.root.values, editorconfig.index.name, xmlProperties, yaml.keys.name, Py.module.name, Py.setuptools.namespace].
2021-09-27 16:03:59,991 [ 2237] INFO - penapi.application.Experiments - Experimental features enabled for user: wsl.p9.support, wsl.prefer.p9.support, wsl.p9.show.roots.in.file.chooser, wsl.execute.with.wsl.exe, linux.native.menu, recent.and.edited.files.together, show.create.new.element.in.popup, search.everywhere.mixed.results, editor.reader.mode, new.large.text.file.viewer
2021-09-27 16:03:59,995 [ 2241] INFO - penapi.wm.impl.GlobalMenuLinux - Start glib main loop in thread: GlobalMenuLinux loop
2021-09-27 16:03:59,997 [ 2243] INFO - penapi.wm.impl.GlobalMenuLinux - Closed dbus-service 'com.canonical.AppMenu.Registrar'
2021-09-27 16:04:00,024 [ 2270] INFO - penapi.application.Experiments - Experimental feature 'terminal.shell.command.handling' is now turned OFF
2021-09-27 16:04:00,030 [ 2276] INFO - exImpl$StubIndexInitialization - Index data initialization done: 49 ms. Initialized stub indexes: {Py.class.attributes, Py.function.shortName, ini.property.key, Py.class.shortName, Py.variable.shortName, Python.Decorator, Py.class.super, Py.class.shortNameInsensitive, Py.module.attribute, properties.index, markdown.header, dom.elementClass, dom.namespaceKey}.
2021-09-27 16:04:00,216 [ 2462] INFO - pl.local.NativeFileWatcherImpl - Starting file watcher: /usr/share/pycharm/bin/fsnotifier
2021-09-27 16:04:00,247 [ 2493] INFO - pl.local.NativeFileWatcherImpl - Native file watcher is operational.
2021-09-27 16:04:00,564 [ 2810] INFO - penapi.wm.impl.GlobalMenuLinux - created instance of GlobalMenuLinux for xid=0x2e00047
2021-09-27 16:04:00,668 [ 2914] INFO - rojectCodeStyleSettingsManager - Initialized from default code style settings.
2021-09-27 16:04:00,674 [ 2920] INFO - eStyle.CustomCodeStyleSettings - Loaded com.jetbrains.python.formatter.PyCodeStyleSettings
2021-09-27 16:04:00,675 [ 2921] INFO - eStyle.CommonCodeStyleSettings - Loaded Python common code style settings
2021-09-27 16:04:00,695 [ 2941] INFO - el.ide.impl.WorkspaceModelImpl - Load workspace model from cache in 514 ms
2021-09-27 16:04:00,749 [ 2995] WARN - #com.intellij.ui.jcef.JBCefApp - JCEF runtime library is not a JBR module (Use JBR bundled with the IDE)
...
```

Steps to reproduce:
1. Install pycharm-community-edition 2021.2.2-1
2. Launch Pycharm
3. Ensure the Markdown plugin is enabled
4. Open a markdown file (e.g. /usr/share/licenses/java11-openjdk/java.base/unicode.md)
5. Click File -> Settings -> Languages & Frameworks -> Markdown
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:02 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/pycharm-community-edit ion/issues/1
Comment by Mefistofeles (mefistofeles) - Wednesday, 06 October 2021, 15:25 GMT
I can confirm this behavior. I wonder if there's a way to build the package in a way that it includes the JBR (Jetbrains runtime). Because as far as I can see, it is not including the JBR and this is probably the source of the problem. Why is it not including it?
Comment by Brandon (hashstat) - Friday, 22 October 2021, 23:29 GMT
It looks like this also affects the Code Lens feature. Hovering in the scroll bar does not show the code lens even though it is enabled. Again, running with the bundled jbr java runtime corrects the issue.
Comment by Mefistofeles (mefistofeles) - Thursday, 02 December 2021, 19:52 GMT
I can see the Code Lens feature is now working with current version 2021.2.3-1 but, as far as I can see, the markdown preview is still not working. Any updates?
Comment by Sooraj S Prakash (soorajsprakash) - Sunday, 24 July 2022, 03:29 GMT
I have the same issue when downloaded PyCharm from official repo (extra).
So, I went to jetbrains site and downloaded pycharm community edition tar file.
Then extracted and ran.
Now markdown preview works perfect without any tweaking.

{
Upon checking `archlinux-java status`, it shows only java-18, earlier it showed java-11 too when I installed pycharm from community edition. I removed java-18 completely and tried pycharm again, then also it didnt worked.
And now installing from tar file, markdown issue is resolved.
I think the issue is with improper java config using archlinux-java.
BUT HOW TO FIX IT WITH PYCHARM FROM OFFICIAL REPO??
}
Comment by Pouya MN (pmn) - Wednesday, 18 January 2023, 11:07 GMT
The problem with the official repo package is the launcher at /usr/bin/pycharm
it enforces the use of openJDK-17 (unless set in the env) then it executes the
original pycharm launcher at `/usr/share/pycharm/bin/pycharm.sh`.
So the solution is either use the original launcher directly (`/usr/share/pycharm/bin/pycharm.sh`) or set the environment variable PYCHARM_JDK to the value in this file: `~/.config/JetBrains/{PycharmVersion}/pycharm.jdk`

Loading...