Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS 3.26 qgis_app.dll not found #49148

Closed
1 of 2 tasks
kiri03 opened this issue Jun 24, 2022 · 36 comments
Closed
1 of 2 tasks

QGIS 3.26 qgis_app.dll not found #49148

kiri03 opened this issue Jun 24, 2022 · 36 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Packaging

Comments

@kiri03
Copy link

kiri03 commented Jun 24, 2022

What is the bug or the crash?

I installed QGIS QGIS (3.26.0). QGIS not loads at all.

image
image

Steps to reproduce the issue

Download file installation

image

Error about crssync.exe.
QGIS not load

Versions

Edición Windows 10 Pro
Versión 21H2
Instalado el ‎26/‎05/‎2020
Compilación del sistema operativo 19044.1766
Experiencia Windows Feature Experience Pack 120.2212.4180.0

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

I looked at qgis-bin.env files and found nothing out of the ordinary when comparing it to qgis-bin.env from version 3.24.3 that works fine.
Clean install from OSGEO4W doesn't work either.

@kiri03 kiri03 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jun 24, 2022
@SrNetoChan SrNetoChan added Packaging Build/Install Related to compiling or installing QGIS labels Jun 24, 2022
@jef-n
Copy link
Member

jef-n commented Jun 24, 2022

See also OSGeo4W #748

@richard-thomas
Copy link

I have the exact same crssync failure (including error code 0xc0000142) today when running OSGeo4W express install of QGIS LTR or QGIS (latest i.e. 3.26.0-1) on Windows 10 21H2... admittedly on a rather old HP Elitebook 8540w. The failure occurs whilst running /etc/postinstall/qgis-common.bat (which directly calls \apps\qgis\crssync) near the end of the OSGeo4W install. This was a clean install running (as administrator) latest osgeo4w-setup.exe downloaded - after uninstalling and deleting all QGIS and OSGeo4W from file system (and most of related registry entries).

@kiri03
Copy link
Author

kiri03 commented Jun 26, 2022

Unable to install qgis 3.26 after several tests and attempts without success.
I hope someone can provide some solution.
Thanks

@marcobra
Copy link

marcobra commented Jun 27, 2022

Same here on Windows 10, after install: at runtime, starting app
image_2022-06-27_11-58-13
then trying to install with osgeo4w-setup.exe i get
image_2022-06-27_12-58-57
ignoring message the installer end without any other errors but qgis is givinga same reported errors,
btw (now i'm not able to reinstall previous or 3.22.8 also same error at runtime, not a big problem i use always Linux)

@jef-n
Copy link
Member

jef-n commented Jun 27, 2022

check which DLL is missing like as noted in #26891 (comment) (or previously mentioned OSGeo4W #748 which points there too)

@kiri03
Copy link
Author

kiri03 commented Jun 27, 2022

Here is the link to download my qgis_app.log

Thanks

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jun 27, 2022

I've installed QGIS 3.26.0 using the OSGeo4W Standalone Installed QGIS-OSGeo4W-3.26.0-3.msi on Windows 10 Home 1903 and I cannot confirm the issue: no crssync.exe error during the installation procedure and QGIS runs without issue.

@gespiel
Copy link

gespiel commented Jun 27, 2022

confirm crssync error installing 3.27-265 via OSGeo4W on win10
3.26.0-3 and 3.22.8-03 via msi-Installer shows no crssync error
In all installations QGIS do not start and brings "app.dll" error.
qgis_osgeo4w_inst_3_27_crsssync_err

@marcobra
Copy link

marcobra commented Jun 28, 2022

check which DLL is missing like as noted in #26891 (comment) (or previously mentioned OSGeo4W #748 which points there too)

Here the qgis_app.log result... as requested
qgis_app.zip
.

@Lunate-Lance
Copy link

Same issue here. Clean install, and problem persists. crssync.exe fails to start. Attempting to run crssync.exe on its own results in errors indicating that qgiscore.dll, gdal305.dll, and Qt5Core.dll are missing, but they are present.

@esmittendorff
Copy link

Same issue here, even after clean windows installation crssync.exe fails to start while running /etc/postinstall/qgis-common.bat (both for 3.26 and 3.22 LTR...)

@TB-archIT
Copy link

It is not only a problem with 3.26.0! Also with LTR 3.22.8 (see #49159). And this IMO should be stable...

qgis-start-error

@esmittendorff
Copy link

Temporary workaround: installing LTR 3.22.7-2 via OSgeo4W shell initially results in the error could not load qgis_app.dll (no crssync.exe error though). Overwriting the entire OSGeo4w folder with a functional instance from another workstation (in this case ltr 3.22.6-2) finally gets qgis working again....

@richard-thomas
Copy link

Can we rename this issue (or should I start a new issue and cross reference this one)? The initial failure that started this issue was the crssync.exe failure during install (whilst attempting to run qgis-common.bat) for any version (including 3.22 LTR). If this occurs then it seems to be the cause of the later "qgis_app.dll not found" error when later trying to then run the badly installed QGIS executable. Perhaps "OSGeo4W Network installer fails at crssync.exe (all QGIS versions)" would better cover it - and raise the awareness of the seriousness of the problem for affected users?

I just tried repeating a clean "express install" of QGIS LTR on Windows 10 21H2 after applying the latest Windows (optional) 28 June update KB5014666 - after running "Disk Cleanup" (system + user), clearing out all the OS4Geo folders, downloads and disabling Microsoft Defender. The problem is still the same for me.

@richard-thomas
Copy link

richard-thomas commented Jul 1, 2022

Additional info on crssync.exe failure for me from Windows "Event Viewer":

Faulting application name: crssync.exe, version: 0.0.0.0, time stamp: 0x62adc791
Faulting module name: tiledb.dll, version: 0.0.0.0, time stamp: 0x6277f9c5
Exception code: 0xc000001d
Fault offset: 0x0000000000001036
Faulting process ID: 0x6d8
Faulting application start time: 0x01d88d39145cbdb9
Faulting application path: C:\OSGeo4W\apps\qgis-ltr\crssync.exe
Faulting module path: C:\OSGeo4W\bin\tiledb.dll
Report ID: 4fd65e50-255b-4df1-81b3-bc58824677f1
Faulting package full name:
Faulting package-relative application ID:

(The file C:\OSGeo4W\bin\tiledb.dll does exist, is 4.63MB in size, with a timestamp of 08/05/2022 18:11)

Researching a bit further, apparently exception code 0xc000001d is "illegal instruction", which may be due to me running a rather old processor (Intel i7-620M from 2010!) which probably doesn't have more recent instruction set extensions (it supports Intel SSE4.1, Intel SSE4.2). Full processor details here:
https://www.intel.co.uk/content/www/uk/en/products/sku/43560/intel-core-i7620m-processor-4m-cache-2-66-ghz/specifications.html

@jef-n
Copy link
Member

jef-n commented Jul 1, 2022

Ah, that's appearently it. tiledb is built with AVX2 support (if the build machine/compiler supports it?) and might crash elsewhere (see TileDB-Inc/TileDB#2861).

@richard-thomas
Copy link

Ah, that's appearently it. tiledb is built with AVX2 support (if the build machine/compiler supports it?) and might crash elsewhere (see TileDB-Inc/TileDB#2861).

Thanks for confirming. I see you've closed the ticket, but where do you suggest those of us with CPUs without AVX2 support go from here?

  • Will the version of tiledb.dll used in OSGeo4W/QGIS be rebuilt with AVX2 disabled? (as in the conda-for-windows ticket you linked to).
  • Or can we complete the installation using an earlier version of tiledb.dll? (if someone can supply one)
  • Or do we need to build everything from source?

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jul 1, 2022

@richard-thomas, a new tiledb package (version 2.8.2-3) is already available in the OSGeo4W v2 repositories.

@kiri03
Copy link
Author

kiri03 commented Jul 1, 2022

I can confirm that my installation with OSGeo4W works correctly again.
The error has been fixed and QGIS 3.26 starts normally now after the tiledb change.

Thanks.

@richard-thomas
Copy link

I can confirm that my installation of QGIS LTR (3.22.8) now works without error (and QGIS then runs happily).
Thanks @jef-n for fixing OSGeo4W - I failed to notice that your closure notice had a link to changing it.

@antoniolocandro
Copy link
Contributor

@jef-n BTW this worked for 3.26 finally but the master version still wont load for me still getting the same message, could this be the same thing for that version? I normally use the dev version for testing but lately I couldn't due to this error. I got Buenos Aires now working at least

@pigreco
Copy link
Contributor

pigreco commented Jul 2, 2022

Also I confirm, the dev version of OSGeo4W v2 does not work, does not start:
image

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jul 3, 2022

@antoniolocandro @pigreco, the qgis-dev issue you are reporting now was due to a different underlying issue: see https://trac.osgeo.org/osgeo4w/ticket/752.
Such issue has been fixed since the latest version 3.27.0-266-0e23467727-1 of the qgis-dev package.

@pigreco
Copy link
Contributor

pigreco commented Jul 3, 2022

@agiudiceandrea
i just upgraded to version 3.27.0-266
image

here's what happens as soon as the download is made:

image

then, as soon as I start the dev:

image

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jul 3, 2022

@pigreco, usually in this cases checking what's wrong with the DLLs is needed as noted in https://trac.osgeo.org/osgeo4w/ticket/748#comment:5 and #26891 (comment).
Anyway, the missing jpeg.dll issue for crssync.exe was discussed in https://trac.osgeo.org/osgeo4w/ticket/748 and already fixed.
Provided you have all the relevant OSGeo4W packages installed and updated to the latest version, the missing jpeg.dll issue could still occur if the gdal-dev305-runtime package is installed. In this case, you need to remove such unneeded package, as advised in https://trac.osgeo.org/osgeo4w/ticket/748#comment:14.

@pigreco
Copy link
Contributor

pigreco commented Jul 3, 2022

@agiudiceandrea
thanks Andrea,
but a definitive solution must be found, a user cannot do all the checks and / or delete files by himself, etc ...
I will wait patiently for the problem to be solved

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jul 3, 2022

@agiudiceandrea thanks Andrea, but a definitive solution must be found, a user cannot do all the checks and / or delete files by himself, etc ... I will wait patiently for the problem to be solved

I agree with you. Anyway, there is no issue with a "fresh" installation the latest qgis-full, qgis-dev-full and qgis-ltr-full packages using the OSGeo4W Network Installer.

If your issue is actually due to the installation of the gdal-dev305-runtime package, then you need to manually uninstall it in order to fix your issue, because AFAIK the OSGeo4W Network Installer doesn't have a mechanism to force the deinstallation of the package to automatically fix the issue.

@pigreco
Copy link
Contributor

pigreco commented Jul 3, 2022

@agiudiceandrea
I searched for the gdal-dev305-runtime file in my PC, but can't find it

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jul 3, 2022

@agiudiceandrea I searched for the gdal-dev305-runtime file in my PC, but can't find it

@pigreco, the gdal-dev305-runtime is not a file, but a package (which puts the gdal305.dll file in the \apps\gdal-dev\bin\ folder), and you can uninstall it using OSGeo4W Setup.

Few hours ago a new version (3.5.0-1-b06e5a3a93-2) of the gdal-dev305-runtime package was specially released.
Since this new version of the package is purposely empty (doesn't contain any file), then updating (using OSGeo4W Setup) the gdal-dev305-runtime package to the 3.5.0-1-b06e5a3a93-2 version has now the same effect as uninstalling it.

@gespiel
Copy link

gespiel commented Jul 3, 2022

After install gdal-dev runtime 3.5.0.1, qgis-dev 3.27.0-266 now beginns to start, but with a crash on startup.

Crash ID: Not available

Stack Trace
No stack trace is available.

QGIS Info
QGIS Version: 3.27.0-Master
QGIS code revision: 0e23467
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.6.0dev-104e174774
Running against GDAL: 3.6.0dev-104e174774

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19044

It seems the crash, which is reported from @agiudiceandrea in the post above
I will ty a new intallation with qgis dev-full package

-->After Installing qgis-dev-full, the crash on startup persist.

@jef-n
Copy link
Member

jef-n commented Jul 3, 2022

-->After Installing qgis-dev-full, the crash on startup persist.

no surprise. qgis-dev-full doesn't contain any files, it just has a bunch of dependencies - including qgis-dev. So you are still running the same binaries from qgis-dev.

@simonokeefe
Copy link
Contributor

I too experienced the "Could not load qgis_app.dll" error. The error message said "Check C:\OSGeo4W\bin\qgis-ltr-bin.env for correct environment paths", however I saw that this file did not exist.

I found a qgis-ltr-bin.env file from a previous installation on another PC and copied it to the expected location. This enabled QGIS to open.

I still had to edit the file in order to get ECWs to work.

Before:

GDAL_DATA=C:\OSGeo4W\share\gdal
GDAL_DRIVER_PATH=C:\OSGeo4W\bin\gdalplugins

After:

GDAL_DATA=C:\OSGeo4W\apps\gdal\share\gdal
GDAL_DRIVER_PATH=C:\OSGeo4W\apps\gdal\lib\gdalplugins

@AScott-WWF
Copy link

AScott-WWF commented Sep 20, 2023

I'd like to add my comments to this issue.
We too are encountering the same issue (on both fresh installs and upgrade installs)
I use the OSGeo4W installer to install (and/or upgrade) QGIS LTR
We deploy QGIS LTR to a small number of users using Intune as our Application deployment method, this is deployed using a PowerShell script (originally sourced from: https://gist.github.com/Guts/6303dc5eb941eb24be3e27609cd46985), my slightly modified script is as follows:

"Begin: $ENV:PROCESSOR_ARCHITECTURE" >> "C:\Windows\Temp\Test.txt"
If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") {
     Try {
         &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH
     }
     Catch {
         Throw "Failed to start $PSCOMMANDPATH"
     }
     Exit
}

"End: $ENV:PROCESSOR_ARCHITECTURE" >> "C:\Windows\Temp\Test.txt"
#Requires -RunAsAdministrator

<#
=========================================================================================
Install-OSGeo4W_QGIS-LTR.ps1
-----------------------------
.Synopsis
   Download the OSGeo4W installer then download and install QGIS LTR (through the 'full' meta-package).
.DESCRIPTION
   This script will:
      1. change the current directory to the user downloads folder
      2. download the OSGeo4W installer
      3. launch it passing command-line parameters to INSTALL QGIS LTR
    Documentation reference: https://trac.osgeo.org/osgeo4w/wiki/CommandLine
#>

<#
=========================================================================================
Adrian Scott
7th December 2022

Original file sourced from: https://gist.github.com/Guts/6303dc5eb941eb24be3e27609cd46985

=========================================================================================
#>

Write-Host "=== Start installing / upgrading QGIS LTR..." -ForegroundColor Green

# Save current working directory
$starter_path = Get-Location

# Move into the user download directory
Set-Location -Path "$($env:USERPROFILE)\Downloads"

# Set saved name of File to be downloaded
$OutFile = "osgeo4w-setup.exe"

# Download installer
Write-Host " = Start downloading the OSGeo4W installer..." -ForegroundColor Yellow
Invoke-WebRequest -Uri "https://download.osgeo.org/osgeo4w/v2/osgeo4w-setup.exe" -OutFile $OutFile

# Download and install (same command to upgrade with clean up)
Write-Host " = Start installing / upgrading QGIS LTR..." -ForegroundColor Yellow
& .\$($OutFile) `
    --quiet-mode `
    --advanced `
    --arch x86_64 `
    --autoaccept `
    --delete-orphans `
    --local-package-dir "$($env:APPDATA)\OSGeo4W_v2-Packages" `
    --menu-name "QGIS LTR" `
    --no-desktop `
    --packages qgis-ltr-full `
    --root "$($env:ProgramFiles)\OSGeo4W_v2" `
    --site "https://www.norbit.de/osgeo4w/v2" `
    --site "https://download.osgeo.org/osgeo4w/v2" `
    --site "https://ftp.osuosl.org/pub/osgeo/download/osgeo4w/v2" `
    --upgrade-also `
 | out-null

# Return to the initial directory
Set-Location -Path $starter_path
Write-Host "==== Work is done!" -ForegroundColor Green

So, up until the release of QGIS LTR version 3.28.9 (or 3.28.8), this script had worked fine, but since then it appears that we are encountering the same issue:
image

From my basic understanding it appears that during the install, the path does not get updated (as it had previously), so when running the QGIS application the qgis_app.dll can not be found, hence the error message.
I also note that on a new and upgraded install that the qgis-ltr-bin.env file does not exist so it is not possible to Check this file for correct environment paths.
I have re-visited the command line syntax for the OSGeo4W installer (https://trac.osgeo.org/osgeo4w/wiki/CommandLine), to double check there is no changes to the syntax (or mistakes in my command), but all seems as it always has.
FYI: All our devices run Windows 10 Enterprise (x64) version 22H2 with latest September (or August) 2023 Windows updates installed i.e. Build 10.0.19045.3348

I suspect the installer is failing to complete at some point and not running the procedure that amends the environment path

N.B. Raised a new case #54678 as I believe this is still a current issue

@cnkant
Copy link

cnkant commented Feb 26, 2024

I encountered the same issue when I tried to run QGIS versions 3.16, 3.22, and 3.28. Even after reinstalling the program using OSGeo4W, I kept getting an error message saying that OpenCL.dll was missing. Before encountering this problem, I had removed my NVIDIA graphics card from the device and uninstalled its drivers. So, I suspected that the issue might be related to the graphics card driver. Currently, my computer is using the integrated graphics card of an Intel CPU. I reinstalled its driver, and the problem was resolved.

@3DGISKing
Copy link

I encountered the same thing when I built QGIS source and started debugging in the Visual Studio.
I noticed that the reason is because the Windows API function LoadLibrary fails.

#ifdef _MSC_VER
  HINSTANCE hGetProcIDDLL = LoadLibrary( "qgis_app.dll" );
#else
// MinGW
  HINSTANCE hGetProcIDDLL = LoadLibrary( "libqgis_app.dll" );
#endif

  if ( !hGetProcIDDLL )
  {
    DWORD error = GetLastError();
    LPTSTR errorText = NULL;

    FormatMessage(
      FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
      NULL,
      error,
      MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ),
      ( LPTSTR )&errorText,
      0,
      NULL );

    std::string message = "Could not load qgis_app.dll \n Windows Error: " + std::string( errorText )
                          + "\n Help: \n\n Check " + basename + ".env for correct environment paths";
    showError( message, "Error loading QGIS" );

The reason that LoadLibrary fails is mostly because some depencencie of the given dll are not found.
I could fix this by setting debugging env as follows.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Packaging
Projects
None yet
Development

No branches or pull requests