3

For internal messaging the company I work for uses Slack. It allows for a lot of awesome integration with tons of different software and services. I'm making my own bot for sending webhooks to Slack.

I got everything set up and working, I have a Perl script that sends a JSON payload. If I trigger the script manually, everything works flawlessly and my Slack bot sends messages.

However, when the script gets triggered by Finalbuilder (Software for automatic build processing), it it fails. I get the following response:

501 Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for module Net::SSLeay: load_file:The specified module could not be found (LWP::Protocol::https not installed)

So I figured I needed to install the "LWP::Protocol::https" module. I just opened my cpan client and wrote install LWP::Protocol::https

Still get the error after installing the module. I wrote test LWP::Protocol:https, which gave the following response:

Running test for module 'LWP::Protocol::https'
Running make for M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checksum for C:\Strawberry\cpan\sources\authors\id\M\MS\MSCHILLI\LWP-Protocol-https-6.06.tar.gz ok
Scanning cache C:\Strawberry\cpan\build for sizes
............................................................................DONE

  CPAN.pm: Going to build M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for LWP::Protocol::https
Could not read metadata file. Falling back to other methods to determine prerequisites
cp lib/LWP/Protocol/https.pm blib\lib\LWP\Protocol\https.pm
  MSCHILLI/LWP-Protocol-https-6.06.tar.gz
  C:\Strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\Strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,'blib\lib', 'blib\arch')" t/*.t
t/apache.t ....... ok
t/https_proxy.t .. 1/56 # creating cert for direct.ssl.access
# creating cert for direct.ssl.access
# creating cert for foo
# creating cert for bar
# creating cert for foo
# creating cert for foo
# creating cert for bar
# creating cert for bar
t/https_proxy.t .. ok
All tests successful.
Files=2, Tests=61,  8 wallclock secs ( 0.02 usr +  0.01 sys =  0.03 CPU)
Result: PASS
  MSCHILLI/LWP-Protocol-https-6.06.tar.gz
  C:\Strawberry\c\bin\dmake.EXE test -- OK

I can trigger my script with windows CMD, or Finalbuilder. Both will work just fine, but when the Finalbuilder project gets activated through Continua CI, I get the "can't load ssleay.dll" error.

I have no clue what to do now. Does anyone know how I can fix the Perl error?

Bjørnar Hagen
  • 757
  • 1
  • 8
  • 19
  • Current versions of Strawberry Perl ship already with the necessary modules. Simply use a newer version. – Steffen Ullrich Mar 04 '15 at 14:01
  • You are misinterpreting the error message. LWP is reporting that LWP::Protocol::https isn't installed because it got an error when trying to load LWP::Protocol::https. That error being the one thrown by Net::SSLeay: Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll'. That means Net::SSLeay isn't properly installed. – ikegami Mar 04 '15 at 14:24
  • Sorry if my question is poorly asked, I'm not familiar with Perl. I have Net-SSLeay-1.68 installed., and Net::SSLeay passes the cpan test. – Bjørnar Hagen Mar 04 '15 at 14:32
  • 1
    You say that, yet when you you did `use Net::SSLeay;`, you got `Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll'`. That means you ran your code in a different environment than the one in which you ran your tests. (Include `@username` when talking to someone so they get notified.) – ikegami Mar 04 '15 at 15:24
  • @ikegami I don't have `use Net::SSLeay` in the code. Here is my Perl script: https://gist.github.com/bearhagen/e969eaa23673e9484614 – Bjørnar Hagen Mar 04 '15 at 16:00
  • Not directly, but the code behind line 100 does. – ikegami Mar 04 '15 at 16:04
  • @ikegami Oh okey. But it's in the same environment as the one I ran my tests. Continua CI (which starts the Finalbuilder project) is logged on as Adminstrator, which is the user I did my tests from. I installed Strawberry Perl earlier today. – Bjørnar Hagen Mar 04 '15 at 16:13
  • You say they're the same, but then you spend the rest of your comment specifying differences. – ikegami Mar 04 '15 at 16:21

4 Answers4

1

I got this same error while running scripts from IDE, but not from command line (same issue).

My command line was adding these to the path. (These were not globally defined).

c:\perl\perl\bin;c:\perl\sup\bin;c:\perl\c\bin;

But the IDE didn't have these. So same fix should work for FinalBuilder, it is missing the perl path information.

Jens
  • 69,818
  • 15
  • 125
  • 179
0

Have you loaded the header files? I don't know what they are for Windows but in Linux, they're called: libssl-dev and zlib1g-dev

shawnhcorey
  • 3,545
  • 1
  • 15
  • 17
0

I also had this error for awhile. In my case the solution was quite simple. It turned out that I hadn't restarted the SVN service, so when it ran the post-commit.bat file the PATH environment hadn't been updated to reflect the new paths that had been added during the Perl install.

While I was testing I was running from a new console window which had the correct PATH, but as soon as it ran from the batch file via SVN it broke, with exactly the same error you posted.

Jens
  • 69,818
  • 15
  • 125
  • 179
2D1C
  • 416
  • 3
  • 6
0

Same problem with IDE Eclipse, command line fine but error with IDE. I check the location:

C:\>perldoc -l LWP::Protocol::https
C:\zailperl\perl\vendor\lib\LWP\Protocol\https.pm

And I add it to Environments variables. I didn't want to reboot my PC so I add the parent path to the IDE. Right click on project.

enter image description here

Jens
  • 69,818
  • 15
  • 125
  • 179
ZAIL
  • 1
  • 2