Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#641 closed defect (fixed)

rbatch breaks QGIS/Qt

Reported by: jef Owned by: hellik
Priority: major Component: Package
Version: Keywords: pkg-rbatch
Cc: hellik

Description

Change History (19)

comment:1 by hellik, 4 years ago

rbatch doesn't add RStudio to %PATH%.

comment:2 by hellik, 4 years ago

RStudio is added to %PATH% by env.bat.

As this functionality is asked by many GRASS community members, I'm inclined not to change.

comment:3 by jef, 4 years ago

Then what is %OSGEO4W_ROOT%\etc\ini\rbatchfiles.bat about?

comment:5 by jef, 4 years ago

Which R binaries are actually invoked by GRASS? Might an wrapper batch file in %OSGEO4W_ROOT%\bin that sets the path and invokes R an alternative?

comment:6 by houska1, 4 years ago

Hi there. I'm the bug reporter at the github link jef added 11 days ago. Pinging to see if any luck resolving this. New QGIS point release is due at end of week, so hoping this can be resolved prior to next OSGeo4W packaging of it. Thanks!

comment:7 by jef, 4 years ago

Resolution: fixed
Status: assignedclosed

%OSGEO4W_ROOT%\etc\ini\rbatchfiles.bat removed.

comment:8 by baswein, 4 years ago

Just wanted to give an update on this I just installed 3.14.16-1 and the problem persists for me. However I seem to have a workaround. If I start QGIS without Grass and I try to run a Grass algorithm I get a warning that the grass folder is not correctly configured. "C:\OSGeo4W64\bin\bin" does not contain a valid set of GRASS 7 modules. Looking in that folder I see that there is no bin folder in the bin folder. There is a xbin folder with grass files (It is possible that this is left over from other troubleshooting with grass in past years) anyway if I make that folder bin instead I can run grass algorithms from QGIS without grass. Starting QGIS with Grass still doesn't work and I am not sure what the difference is.

in reply to:  8 comment:9 by jef, 4 years ago

Replying to baswein:

if I make that folder bin instead I can run grass algorithms from QGIS without grass. Starting QGIS with Grass still doesn't work and I am not sure what the difference is.

env.bat in grass also adds the rstudio path to PATH. If you can rename the rstudio path and qgis starts, then that's still the culprit.

If we knew which binaries from rstudio are actually used (see https://trac.osgeo.org/osgeo4w/ticket/641?replyto=8#comment:5), then (a) wrapper(s) batch files placed in {{%OSGEO4W_ROOT%/bin}} that are invoked instead of adding the rstudio with the wrong Qt to PATH could be an option to solve this.

comment:10 by baswein, 4 years ago

I'm happy to try to rename it but this is all a bit over my head. What do I change it to? I assume it is these lines:

REM set RStudio temporarily to %PATH% if it exists IF EXIST "%ProgramFiles%\RStudio\bin\rstudio.exe" set PATH=%PATH%;%ProgramFiles%\RStudio\bin REM set R_USER if %USERPROFILE%\Documents\R\ exists to catch most common cases of private R libraries

in reply to:  10 comment:11 by jef, 4 years ago

Replying to baswein:

I'm happy to try to rename it but this is all a bit over my head. What do I change it to?

Just go into %ProgramFiles% and rename RStudio and try to start QGIS. But that's just to verify that it's the actual cause of the issue - which I think it is. It's not an actual solution.

Removing the lines from env.bat should help too, but that way GRASS won't be able to call it anymore. Wrappers that are placed in an directory already in PATH could help with that - but I don't know which binaries are actually called, for which wrappers would need to be produced…

comment:12 by baswein, 4 years ago

Thanks. I changed the rstudio folder in C:\Program Files to xrstudio and QGIS with Grass will start. So it seems to be the culprit.

in reply to:  12 comment:13 by jef, 4 years ago

Replying to baswein:

Thanks. I changed the rstudio folder in C:\Program Files to xrstudio and QGIS with Grass will start. So it seems to be the culprit.

Try this please: Remove the qgis-bin.env from %OSGEO4W_ROOT%\bin, move call "%OSGEO4W_ROOT%\apps\grass\grass78\etc\env.bat" below the line call qt5_env.bat in qgis-grass7.bat and invoke it.

comment:14 by houska1, 4 years ago

Friends, I see this has been closed. However, I just upgraded to the latest OsGeo4W install of QGIS 3.14.16-2 and rbatch 149-5, and the problem came back. I was able to work around as in prior comments here, but noting here it does not seem to be fixed yet in the distribution.

comment:15 by jef, 4 years ago

Fixed in qgis-grass-plugin7 3.14.16-3 and qgis-ltr-grass-plugin7 3.10.10-3.

comment:16 by andreaerdna, 4 years ago

As reported by an Italian user on a facebook support group, it seems that updating qgis-grass-plugin7 to version 3.14.16-3 or also installing today from scratch qgis with grass (with qgis-grass-plugin7 3.14.16-3) via the OSGeo4W network installer on a Windows 8.1 system, does not solve the issue.

The reported error is

https://scontent-mxp1-1.xx.fbcdn.net/v/t1.0-9/119985426_10223475069014566_1816775042224108409_n.jpg

The procedure entry point
?glyphCache@QFontEngine@@QEBAPEAVQFontEngineGlyphCache@@PEBXW4GlyphFormat@1@AEBVQTransform@@@Z
could not be located in the dynamic link library C:\OSGEO\apps\qtS\bin\Qt5OpenGL.dll.

In his system is installed RStudio.

qgis-bin-g7.env contains the following value for the PATH variable:

PATH=C:\OSGEO4~2\apps\qgis\bin;C:\OSGEO4~2\apps\grass\grass78\lib;C:\OSGEO4~2\apps\grass\grass78\bin;C:\OSGEO4~2\apps\Python37;C:\OSGEO4~2\apps\Python37\Scripts;C:\OSGEO4~2\apps\Python37;C:\OSGEO4~2\apps\Python37\Scripts;C:\OSGEO4~2\apps\qt5\bin;C:\OSGEO4~2\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32\WBem;C:\Program Files\RStudio\bin

The only way to get QGIS to start was to remove ";C:\Program Files\RStudio\bin" from the end of the PATH variable string in qgis-bin-g7.env (or to move/rename the folder bin in "C:\Program Files\RStudio\")

comment:17 by houska1, 4 years ago

Confirming that for me as well, qgis-bin-g7 will not start unless I manually remove the RStudio\bin directory from the PATH in qgis-bin-g7.env

This is on Win10, after an upgrade on Friday including qgis-grass-plugin7 3.14.16-3; qgis, qgis-common, and qgis-grass-plugin-common 3.14.16-2; and rbatch 149-5.

comment:18 by andreaerdna, 4 years ago

comment:19 by andreaerdna, 4 years ago

Yet another issue report https://github.com/qgis/QGIS/issues/39310.

In https://github.com/qgis/QGIS/issues/39310#issuecomment-707006224 is also reported the following issue with qgis-grass-plugin7 3.14.16-3:

On a clean Windows 10 machine ... on activating the GRASS plugin I get

2020-10-12T10:32:43 WARNING GRASS init error : Problem in GRASS initialization, GRASS provider and plugin will not work : Module built against version 8bcecc9a6 but trying to use version d8fbd49af. You need to rebuild GRASS GIS or untangle multiple installations.

that I guess depends on the fact that QGIS package is 3..14.16-2 and the GRASS plugin one is 3.14.16-3. Downgrading the latter to -2 and everything is ok.

Note: See TracTickets for help on using tickets.