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

BigSQL Postgres 9.6 Windows Support #17

Closed
Goldfish42 opened this issue May 24, 2017 · 21 comments
Closed

BigSQL Postgres 9.6 Windows Support #17

Goldfish42 opened this issue May 24, 2017 · 21 comments

Comments

@Goldfish42
Copy link

I've been using PLR on Postgres 9.4 successfully for a long time on a Windows 7 machine, but I'm currently faced with setting up a new machine with a fresh install of Windows 10 x64. On the new machine, I'm looking to upgrade to Postgres 9.6 with R 3.3.1, and BigSQL's PGC command line interface has proven extremely easy for setting up extensions (e.g. PostGIS) for their distributions. I was hoping to be able to install PLR via PGC's easy interface, but no such luck.

I managed to find the 9.6 Windows plr.dll here. I dropped it into C:\PostgreSQL\pg96\lib\postgresql, which is a slightly different location from what I'm used to on EnterpriseDB distributions. I placed plr.control, plr.sql, plr--8.3.0.17.sql and plr--unpackaged--8.3.0.17.sql into C:\PostgreSQL\pg96\share\postgresql\extension and then attempted to install the extension with the following error:

ERROR: could not load library "C:/POSTGR~1/pg96/lib/postgresql/plr.dll": The specified module could not be found.

To be sure, I tried installing PLR 8.3.0.16 on an instance of BigSQL's Postgres 9.5 with R 3.3.0 using the plr.dll from here, but I ran into the same error.

Do you think these problems are just related to the BigSQL distributions? Has anyone gotten PLR working on those yet?

@davecramer
Copy link
Collaborator

Can you try reinstalling postgres using Enterprisedb and then installing plr. This combination should work

@scott-mead
Copy link

sgennaria,
This happens from time to time on windows due to short vs long paths. My guess is it's mostly a distribution issue. Let me take a look and test and see if we can get a fix out soon.

@scott-mead
Copy link

So, I looked back, we're not yet distributing pl-R through BigSQL. I'll go back and see exactly which issues we were having and update this ticket when I have more info.

@Goldfish42
Copy link
Author

Thanks for looking into this. I just tried a fresh EnterpriseDB install for 9.6 and got the same error with the 8.3.0.17 distro found here. However, when I installed 9.5 and used the 8.3.0.16 distro from Joe Conway's site, it worked. At least this narrows down some of my problems, but I'm not sure what to do next to troubleshoot 8.3.0.17.

@davecramer
Copy link
Collaborator

So to summarize

using enterprisedb + 8.3.0.16 it works
using enterprisedb + 8.3.0.17 it does not
using bigsql + either of these does not work ?

@Goldfish42
Copy link
Author

Correct.

@davecramer
Copy link
Collaborator

OK, so apparently the docs need to be fixed. This note is in compiling.md

IF YOU INSTALLED R IN Program Files\R\R... the PATH MUST HAVE C:\Program Files\R\R\bin\x64 or C:\Program Files\R\R\bin\i386

Can you try that with 8.3.0.17 please

@Goldfish42
Copy link
Author

Goldfish42 commented May 25, 2017

I've been using the R\bin\x64 path all along during my attempts. To be clear, here are my additional PATH settings for each attempt:

BigSQL PG9.6 (PLR 8.3.0.17 Install Failed):

C:\Program Files\R\R-3.3.1\bin\x64;
C:\PostgreSQL\pg96\bin;
C:\PostgreSQL\pg96\lib;
C:\PostgreSQL\pg96\lib\postgresql

BigSQL PG9.5 (PLR 8.3.0.16 Install Failed):

C:\Program Files\R\R-3.3.0\bin\x64;
C:\PostgreSQL\pg95\bin;
C:\PostgreSQL\pg95\lib;
C:\PostgreSQL\pg95\lib\postgresql

EnterpriseDB PG9.6 (PLR 8.3.0.17 Install Failed):

C:\Program Files\R\R-3.3.1\bin\x64;
C:\Program Files\PostgreSQL\9.6\bin;
C:\Program Files\PostgreSQL\9.6\lib

EnterpriseDB PG9.5 (PLR 8.3.0.16 Install Succeeded):

C:\Program Files\R\R-3.3.0\bin\x64;
C:\Program Files\PostgreSQL\9.5\bin;
C:\Program Files\PostgreSQL\9.5\lib

Whenever trying a 9.5 install, my R_HOME environment variable is:

C:\Program Files\R\R-3.3.0

Whenever trying 9.6, R_HOME is:

C:\Program Files\R\R-3.3.1

And I also restart the Postgres service after each change to the environment variables, prior to attempting each PLR install.

@davecramer
Copy link
Collaborator

Thanks, I've been able to replicate this. Currently working on getting a version that should work on bigsql

@davecramer
Copy link
Collaborator

davecramer commented May 26, 2017

@sgennaria can you check this https://drive.google.com/file/d/0B2KHiwChy0D2WWVCSDNoNUhNNzg/view?usp=sharing out

This should work with the latest edb postgresql install

@Goldfish42
Copy link
Author

Unfortunately, it failed again with the same error. I tried this with PLR 8.3.0.17 for both BigSQL and EnterpriseDB distros of PG 9.6.

@birdwrangler
Copy link

@davecramer I've been having the same issue as sgennaria. I'm using Windows 10 with Postgres 9.5, and R3.3.3. Below is what I've listed in my PATH, and R_HOME is set as C:\Program Files\R\R-3.3.3. I've just tried using the plr.dll file you posted, but it also failed. I'm using pgadmin 3.

C:\Program Files\R\R-3.3.3\bin\x64;
C:\PostgreSQL\pg95\bin;
C:\PostgreSQL\pg95\lib;
C:\PostgreSQL\pg95\lib\postgresql

@davecramer
Copy link
Collaborator

davecramer commented May 27, 2017

@birdwrangler the one I posted is only for 9.6
@sgennaria I built it this morning on windows 10 and on a freshly downloaded 9.6.3 from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows

@birdwrangler
Copy link

@davecramer I realized that, but figured I'd try it since nothing else has worked so far, and I was getting the same error message.

@davecramer
Copy link
Collaborator

@birdwrangler any chance you can try 9.6 ?

@ringerc
Copy link

ringerc commented May 29, 2017

The key thing to realise here is that this message is a damn lie:

ERROR: could not load library "C:/POSTGR~1/pg96/lib/postgresql/plr.dll": The specified module could not be found.

What Windows means here is "The specified module [or a module it depends on] could not be found".

Most likely this plr.dll tries to link to some DLL you don't have in the runtime path of the running postgres. This may or may not be the same as the runtime path of your current user. Windows doesn't have any LD_LIBRARY_PATH or DYLD_LIBRARY_PATH, it's DLL loading rules are roughly: check the current directory, then the WinSxS, then the PATH of the current process.

A good start would be to get Dependency Walker (depends.exe) from http://www.dependencywalker.com/ and examine the DLL from there. Check where it's loading required modules and whether there are any missing.

If there aren't any missing, they might still not be found on the PATH your postgres is running with. I don't remember how to check that easily though, so start with the above.

My guess is that you're probably missing a required MSVC runtime redist.

@Goldfish42
Copy link
Author

Goldfish42 commented May 29, 2017

@ringerc So I just ran Dependency Walker on the latest DLL and it appears to indicate a lot of problems, but I'm not seeing exactly how to resolve these problems. Hundreds of DLLs show up as missing modules. In the middle pane, these modules have an error:

Error opening file. The system cannot find the file specified (2).

Almost all of these modules have long, hyphenated names like:

API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL
down to
EXT-MS-WIN-WWAN-WWAPI-L1-1-1.DLL

Per your suggestion, I installed MSVC++ Redistributable for VS2015 which did solve the missing VCRUNTIME.DLL error, however there are still other DLLs which are missing, and Google isn't providing useful answers:

DEVICELOCKHELPERS.DLL
EMCLIENT.DLL
IESHIMS.DLL

There are also 3 DLLs that have warnings:

SHCORE.DLL
SHLWAPI.DLL
IEFRAME.DLL

Shouldn't all such dependencies (like the MSVC Redistributable) be listed in the install instructions?

@davecramer
Copy link
Collaborator

davecramer commented May 29, 2017 via email

@Goldfish42
Copy link
Author

Goldfish42 commented May 29, 2017

In my haste to check back with the Dependency Walker, I forgot to attempt to install PLR after installing the MSVC Redistributable. It turns out that's just what I needed. The PLR install worked successfully on both the BigSQL and EnterpriseDB 9.6 distros. Weirdly, the PATH values leading to BigSQL locations worked even when I tried with EnterpriseDB (accidentally). Is this normal?

Thanks for everyone's help with this!

@davecramer
Copy link
Collaborator

Doesn't surprise me that it works, but I would like to understand it.
@birdwrangler does any of this help you ?

@birdwrangler
Copy link

@davecramer I'm out of the office for a few days, but will definitely try these suggestions when I get back. Thanks! Fingers crossed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants