Page 1 of 1

ODBC installation failed after migration to wpat 2.2

Published: September 2, 2022 - 12:44 PM
by jlatieule
Good morning,


In wapt 1.8, a package allowed the installation of the Oracle client with ODBC, but this is no longer possible following the upgrade to wapt 2.2
I have the impression that I have an error in the output that is preventing me from going any further
How can I ignore it or force it?

The ODBC installation is done using the following PowerShell command

Code: Select all

Add-OdbcDsn -DriverName "Oracle dans OraClient11g_home1" -DsnType System -Name LOGI -SetPropertyValue @("Server=LOGI", "Description=LOGI", "User=LOGI")
In the PowerShell console, I get an error message, but it's not a blocking issue
Add-OdbcDsn: Driver ConfigDSN, ConfigDriver, or ConfigTranslator failed (Installer error code: 11).
At line:1 char: 1
+ Add-OdbcDsn -DriverName "Oracle in OraClient11g_home1" -DsnType Sys ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: NotSpecified: (LOGI (Source of...e 32-bit ODBC):Root/Microsoft/...SFT_OdbcDsnTask) [Add-OdbcDsn], CimException
+ FullyQualifiedErrorId: MI RESULT 0,Add-OdbcDs
I hid it by adding arguments -errorAction silentlyContinue

Code: Select all

Add-OdbcDsn -DriverName "Oracle dans OraClient11g_home1" -DsnType System -Name LOGI -SetPropertyValue @("Server=LOGI", "Description=LOGI", "User=LOGI") -errorAction silentlyContinue
The return of the PyScripter console is

Code: Select all

Client Oracle déjà installé
Mise à jour du fichier TnsName
Installation des drivers ODBC
2022-09-02 12:41:41,441 CRITICAL Fatal error in install script: CalledProcessErrorOutput: Command 'powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -OutputFormat text -EncodedCommand "JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQAgAD0AIAAiAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIgAKAEEAZABkAC0ATwBkAGIAYwBEAHMAbgAgAC0ARAByAGkAdgBlAHIATgBhAG0AZQAgACIATwByAGEAYwBsAGUAIABkAGEAbgBzACAATwByAGEAQwBsAGkAZQBuAHQAMQAxAGcAXwBoAG8AbQBlADEAIgAgAC0ARABzAG4AVAB5AHAAZQAgAFMAeQBzAHQAZQBtACAALQBOAGEAbQBlACAATABPAEcASQAgAC0AUABsAGEAdABmAG8AcgBtACAAMwAyAC0AYgBpAHQAIAAtAFMAZQB0AFAAcgBvAHAAZQByAHQAeQBWAGEAbAB1AGUAIABAACgAIgBTAGUAcgB2AGUAcgA9AEwATwBHAEkAIgAsACAAIgBEAGUAcwBjAHIAaQBwAHQAaQBvAG4APQBMAE8ARwBJACIALAAgACIAVQBzAGUAcgA9AEwATwBHAEkAIgApACAALQBlAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABzAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlACAAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAA" ' returned non-zero exit status 1.
Output::
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 1074, in run_powershell
    result = run(cmd,
  File "C:\Program Files (x86)\wapt\waptutils.py", line 2132, in run
    raise CalledProcessErrorOutput(proc.returncode, cmd, ''.join(output))
waptutils.CalledProcessErrorOutput: Command 'powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -OutputFormat text -EncodedCommand "JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQAgAD0AIAAiAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIgAKAEEAZABkAC0ATwBkAGIAYwBEAHMAbgAgAC0ARAByAGkAdgBlAHIATgBhAG0AZQAgACIATwByAGEAYwBsAGUAIABkAGEAbgBzACAATwByAGEAQwBsAGkAZQBuAHQAMQAxAGcAXwBoAG8AbQBlADEAIgAgAC0ARABzAG4AVAB5AHAAZQAgAFMAeQBzAHQAZQBtACAALQBOAGEAbQBlACAATABPAEcASQAgAC0AUABsAGEAdABmAG8AcgBtACAAMwAyAC0AYgBpAHQAIAAtAFMAZQB0AFAAcgBvAHAAZQByAHQAeQBWAGEAbAB1AGUAIABAACgAIgBTAGUAcgB2AGUAcgA9AEwATwBHAEkAIgAsACAAIgBEAGUAcwBjAHIAaQBwAHQAaQBvAG4APQBMAE8ARwBJACIALAAgACIAVQBzAGUAcgA9AEwATwBHAEkAIgApACAALQBlAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABzAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlACAAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAA" ' returned non-zero exit status 1.
Output:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4057, in install_wapt
    exitstatus = setup.install()
  File "c:\waptdev\ophlm-oracle-11g_11.2.0-6_windows_PROD-wapt\setup.py", line 50, in install
    run_powershell('Add-OdbcDsn -DriverName "Oracle dans OraClient11g_home1" -DsnType System -Name LOGI -Platform 32-bit -SetPropertyValue @("Server=LOGI", "Description=LOGI", "User=LOGI") -errorAction silentlyContinue')
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 1078, in run_powershell
    raise CalledProcessErrorOutput(e.returncode, cmd, e.output)
waptutils.CalledProcessErrorOutput: Command 'powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -OutputFormat text -EncodedCommand "JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQAgAD0AIAAiAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIgAKAEEAZABkAC0ATwBkAGIAYwBEAHMAbgAgAC0ARAByAGkAdgBlAHIATgBhAG0AZQAgACIATwByAGEAYwBsAGUAIABkAGEAbgBzACAATwByAGEAQwBsAGkAZQBuAHQAMQAxAGcAXwBoAG8AbQBlADEAIgAgAC0ARABzAG4AVAB5AHAAZQAgAFMAeQBzAHQAZQBtACAALQBOAGEAbQBlACAATABPAEcASQAgAC0AUABsAGEAdABmAG8AcgBtACAAMwAyAC0AYgBpAHQAIAAtAFMAZQB0AFAAcgBvAHAAZQByAHQAeQBWAGEAbAB1AGUAIABAACgAIgBTAGUAcgB2AGUAcgA9AEwATwBHAEkAIgAsACAAIgBEAGUAcwBjAHIAaQBwAHQAaQBvAG4APQBMAE8ARwBJACIALAAgACIAVQBzAGUAcgA9AEwATwBHAEkAIgApACAALQBlAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABzAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlACAAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAA" ' returned non-zero exit status 1.
Output:

FATAL ERROR : CalledProcessErrorOutput: Command 'powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -OutputFormat text -EncodedCommand "JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQAgAD0AIAAiAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIgAKAEEAZABkAC0ATwBkAGIAYwBEAHMAbgAgAC0ARAByAGkAdgBlAHIATgBhAG0AZQAgACIATwByAGEAYwBsAGUAIABkAGEAbgBzACAATwByAGEAQwBsAGkAZQBuAHQAMQAxAGcAXwBoAG8AbQBlADEAIgAgAC0ARABzAG4AVAB5AHAAZQAgAFMAeQBzAHQAZQBtACAALQBOAGEAbQBlACAATABPAEcASQAgAC0AUABsAGEAdABmAG8AcgBtACAAMwAyAC0AYgBpAHQAIAAtAFMAZQB0AFAAcgBvAHAAZQByAHQAeQBWAGEAbAB1AGUAIABAACgAIgBTAGUAcgB2AGUAcgA9AEwATwBHAEkAIgAsACAAIgBEAGUAcwBjAHIAaQBwAHQAaQBvAG4APQBMAE8ARwBJACIALAAgACIAVQBzAGUAcgA9AEwATwBHAEkAIgApACAALQBlAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABzAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlACAAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAA" ' returned non-zero exit status 1.
Output:
Exit code:  3
>>> 

Re: ODBC installation failed after migration to wpat 2.2

Published: September 2, 2022 - 2:33 PM
by sfonteneau
I tried it here (outside of Wapt);

`silentlyContinue` in PowerShell doesn't seem to work and returns an exit code 1.

Strange.

Re: ODBC installation failed after migration to wpat 2.2

Published: September 2, 2022 - 4:20 PM
by dcardon
Have you tried using odbcconf? (I admit I'm a bit allergic to PowerShell) :-) ) ? (syntax needs checking, I don't have Oracle ODBC on my machine)

Code: Select all

odbcconf configsysdsn "Oracle dans OraClient11g_home1" "DSN=LOGI;SERVER=LOGI;DESCRIPTION=LOGI,USER=LOGI"

Re: ODBC installation failed after migration to wpat 2.2

Published: September 6, 2022 - 5:36 PM
by jlatieule
I'll test with odbcconf, but two years ago when I designed the package I already saw the end-of-support alert: https://docs.microsoft.com/fr-fr/sql/od ... rver-ver16
Note:

ODBCCONF.exe will be removed in a future version of Windows Data Access Components. Avoid using this feature and plan to modify any applications that currently use it. You can use PowerShell commands to manage drivers and data sources. For more information about these PowerShell commands, see Windows Data Access Components cmdlets.
I am hesitant to use it because the Oracle client is required for certain data extractions via Excel.
Preferably, I would like to stick with an installation using PowerShell.

It's strange because it worked fine with wapt 1.8; something must have changed on the Python side following the version upgrade

Re: ODBC installation failed after migration to wpat 2.2

Published: September 8, 2022 - 4:53 PM
by dcardon
Is the driver 32-bit or 64-bit? If the driver is 32-bit, be careful, as the PowerShell script launched by Wapt is 64-bit. If this is the case, you need to add the following parameter
-32-bit platform
We need to avoid the errorAction silently ignore, it's not very clean.

If the error code is "normal", it must be added as a parameter to the run_powershell function with the accept_returncodes option.

Sincerely,

Denis