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

Error: DPI-1050 on Windows 7 with Oracle Client 19c #1168

Closed
StefanPavlik opened this issue Oct 28, 2019 · 18 comments
Closed

Error: DPI-1050 on Windows 7 with Oracle Client 19c #1168

StefanPavlik opened this issue Oct 28, 2019 · 18 comments

Comments

@StefanPavlik
Copy link

"Error: DPI-1050: Oracle Client library is at version 0.0 but version 11.2 or higher is needed" is received when running on Windows 7 (64bit).
The same setup works correctly on Windows 10 (64bit)

OS: Windows 7 (Version 6.1 Build 7601, Service Pack 1), 64 bit
Node.js: v8.16.2
oracledb: 4.0.1 (problem observed also with older versions)
Oracle Instant Client: 19.3.0.0.0

The Oracle Instant Client 19.3 is copied into 'node_modules\oracledb\build\Release' directory.
(the same problem observed when PATH variable was adjusted to use the Oracle Instant Client directory).
The Visual Studio 2017 redistributables are installed on computer.

Code to reproduce:

const oracledb = require('oracledb');
const POOL_OPTIONS = {
      connectionString: 'doesNotMatter',
      user: 'userName',
      password: 'password'
    };

oracledb.createPool(POOL_OPTIONS, (error, pool) => {
  if(error) {
    console.log(error);
    return;
  }
    
  console.log('Pool created successfully');
  pool.close();
});

Result:

{ Error: DPI-1050: Oracle Client library is at version 0.0 but version 11.2 or higher is needed
    at OracleDb.createPool (c:\Program Files\PM1EncryptionProxy\node_modules\oracledb\lib\oracledb.js:180:8)
    at OracleDb.createPool (c:\Program Files\PM1EncryptionProxy\node_modules\oracledb\lib\util.js:163:19)
    at Object.<anonymous> (c:\Program Files\PM1EncryptionProxy\oracleProblem.js:8:10)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16) errorNum: 0, offset: 0 } 

Node.js environment:

process.platform // win32
process.version   // v.8.16.2
process.arch       // x64
require('oracledb').versionString  // 4.0.1

Other:
NOTE: The problem does not occur with Oracle Instant Client 18.5.0.0.0

We have tested the problem on several Windows 7 and Windows 10 machines (only 64 bit OS).
The problem is always reproducible on Windows 7 and never on Windows 10.

@cjbj
Copy link
Member

cjbj commented Oct 30, 2019

From other reports, you may not have the latest VS redistributable installed. You need Microsoft Visual Studio 2017 Redistributable. See oracle/python-cx_Oracle#351 (comment)

@StefanPavlik
Copy link
Author

StefanPavlik commented Oct 30, 2019

From other reports, you may not have the latest VS redistributable installed. You need Microsoft Visual Studio 2017 Redistributable. See oracle/python-cx_Oracle#351 (comment)

The installer that is deploying the product (is the same for Windows 10 and Windows 7) installs the Microsoft Visual C++ 2015-2019 Redistributable (v 14.21.27702.2) as proposed in this link.
When the correct VC Redistributale libs are missing the result is different:

{ Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
You must have 64-bit Oracle client libraries in your PATH environment variable.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from
http://www.oracle.com/technetwork/topics/winx64soft-089540.html
A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available.

    at OracleDb.createPool (C:\Program Files\PM1EncryptionProxy\node_modules\oracledb\lib\oracledb.js:180:8)
    at OracleDb.createPool (C:\Program Files\PM1EncryptionProxy\node_modules\oracledb\lib\util.js:163:19)
    at Object.<anonymous> (C:\Program Files\PM1EncryptionProxy\oracleProblem.js:8:10)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16) errorNum: 0, offset: 0 } 

I have tested also Microsoft Visual C++ 2015-2019 Redistributable (v 14.23.27820.0) with same results (error DPI-1050).

Using older version of Oracle Instant Client (18.5.0.0.0) with same VC redistributbale libraries works without problems.

@cjbj
Copy link
Member

cjbj commented Oct 30, 2019

Thanks for the info. I'm not a Windows user and don't have any immediate technical suggestion. Does sqlplus work?

@pvenkatraman
Copy link

I normally unzip the instant client zip files to a directory and add that to the PATH. That works good for all the versions I have tested (11.2 - 19.3).
SET PATH=C:\WORK\SRC\oracledb\IC193;%PATH%
where IC193 contains all the instant client binaries. I use different directories for different versions of instant client and prefix as appropriate.

Can you try this, and also provide me your %PATH% environment variable value.

Also make sure there is only one copy of OCI.DLL (from this directory).

@StefanPavlik
Copy link
Author

Thanks for the info. I'm not a Windows user and don't have any immediate technical suggestion. Does sqlplus work?

I am not familiar with SQLPlus, but I have downloaded the SQLPlus (64bit 19.3.0.0.0) package and unpacked it into Oracle Instant Client directory. After running the sqlplus.exe command the error message was displayed with text:

The procedure entry point GetOverlappedResultEx could not be located in the dynamic link library KERNETL32.dll.

Additional error was written to the console:

Error 57 initializing SQL*Plus
Error loading messages shared library

@StefanPavlik
Copy link
Author

Regarding the PATH variable:
In our setup the Oracle Instant Client is placed in the node_modules\oracledb\build\Release directory as proposed in this link. Therefore I do not need to adjust the PATH variable.

I have made additional test and moved the Oracle Instant Client files to C:\OracleIC193\ and adjusted the PATH variable to be:
PATH=c:\OracleIC193\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;;C:\Program Files\cwRsync\bin;C:\Program Files\Microsoft Network Monitor 3\

I have also checked that only one oci.dll file is installed on the computer.

The result is the same: Error: DPI-1050

@kubo
Copy link

kubo commented Oct 31, 2019

I guess that you cannot use Oracle instant client 19.3 on Windows 7 even if the DPI-1050 error can be resolved.

The procedure entry point GetOverlappedResultEx could not be located in the dynamic link library KERNETL32.dll.

OCI.DLL requires oraociei19.dll (basic) or oraociicus19.dll (basic lite) and both use GetOverlappedResultEx whose minimum supported client version is Windows 8.

@anthony-tuininga
Copy link
Member

ODPI-C assumes that the inability to load the symbol "OCIClientVersion" implies that you have a version of the Oracle client libraries that is too old. Clearly there is another case -- when the symbol in question cannot be loaded due to a missing dependency. Just to confirm that we understand the situation, can you set the environment variable DPI_DEBUG_LEVEL to the value 8 and run the code again and report back what the trace says? Assuming that is indeed the case we should be able to come up with a patch that improves the error message anyway! In the meantime, it would appear that 19.3 is not supported on Windows 7. Considering Windows 7 EOL is January 2020 I'm not sure whether any effort will be made to solve this issue -- but a better error message would be appreciated, I'm sure!

@cjbj
Copy link
Member

cjbj commented Oct 31, 2019

I guess the doc is not just about certified platforms (which it sometimes is) but also technically usable ones: Operating System Checklist for Oracle Database Client Installation

@StefanPavlik
Copy link
Author

After adding the DPI_DEBUG_LEVEL=8 environment variable the output is:

ODPI [04972] 2019-11-04 08:59:35.409: ODPI-C 3.2.1
ODPI [04972] 2019-11-04 08:59:35.409: debugging messages initialized at level 8
ODPI [04972] 2019-11-04 08:59:35.425: internal error DPI-1050: Oracle Client library is at version 0.0 but version 11.2 or higher is needed (dpiContext_create / check Oracle Client version)
{ Error: DPI-1050: Oracle Client library is at version 0.0 but version 11.2 or higher is needed
    at OracleDb.createPool (C:\Program Files\PM1EncryptionProxy\node_modules\oracledb\lib\oracledb.js:180:8)
    at OracleDb.createPool (C:\Program Files\PM1EncryptionProxy\node_modules\oracledb\lib\util.js:163:19)
    at Object.<anonymous> (C:\Program Files\PM1EncryptionProxy\oracleProblem.js:8:10)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16) errorNum: 0, offset: 0 } 

@anthony-tuininga
Copy link
Member

Thanks @StefanPavlik. I was able to find an old copy of Windows 7 on which to test. I am considering adding the following error message instead:

DPI-1072: the Oracle Client library was loaded successfully but is unsupported

This error will be raised if a very old version of the Oracle Client library is loaded (< 10) or if version 19 is loaded on Windows 7. In both cases, determining the version is not directly possible. Comments on the suitability/usefulness of the error message is welcome. We will be discussing internally as well and may adjust it in any case -- but I'd appreciate your comments too!

@tomaspotok
Copy link

Hi, the message is very cryptic. Please state explicitely that the OS is unsupported if possible.

@StefanPavlik
Copy link
Author

I also think that the proposed error message is too generic.
But it has to be generic if it is not possible to distinguish between the two cases (very old OCI vs OCI 19.3 on Win7).

@anthony-tuininga
Copy link
Member

In theory effort could be made to determine if the platform is indeed Windows 7 and other Win32 APIs could be called to examine the DLL in greater detail -- but this would involve a lot of code for little to no benefit. The key point is that the library is unsupported and the documentation should be consulted to determine why. We've added explicit notes about 19c and Windows 7 to the documentation. Hopefully few people will continue using Windows 7 anyway and those who do, recognize that older software should be used with older software. :-)

@tomaspotok
Copy link

We encountered the problem on Windows Server 2008, where support will also end in 2020.

I suggest we use the following text:
DPI-1072: Your Oracle Client library or Windows version is too old (Oracle Client library 11.2 and Windows 8 or higher are needed)

@anthony-tuininga
Copy link
Member

ODPI-C is cross-platform so a specific reference to Windows is not going to be helpful. Perhaps this?

DPI-1072: the Oracle Client library version is unsupported (too old or not supported on this operating system, see installation documentation for details)

The current message in our source repository is the part before the parenthenses. The part in the parentheses may be too wordy or potentially misleading but I'll discuss it with the rest of the team and let you know what we decide. Thanks for the feedback!

@anthony-tuininga
Copy link
Member

We decided to leave the message as "DPI-1072: the Oracle Client library version is unsupported". I understand the message is generic but we have added this message to the documentation so that it is easily searchable. We'd rather spend time on more important aspects of the driver!

@cjbj cjbj changed the title Error: DPI-1050 on Windows 7 Error: DPI-1050 on Windows 7 with Oracle Client 19c Nov 12, 2019
@cjbj
Copy link
Member

cjbj commented Dec 10, 2019

This change was released with node-oracledb 4.1.

@cjbj cjbj closed this as completed Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants