bjowes / cypress-ntlm-auth

Windows authentication plugin for Cypress
MIT License
54 stars 9 forks source link

Unable to start cypress-ntlm on Jenkins - 'ERR_INVALID_URL' #254

Closed sham-christopher closed 3 months ago

sham-christopher commented 3 months ago

Hello,

I am trying to run Cypress tests on Jenkins but I always get the following error. ` + DEBUG=cypress:plugin:ntlm-auth

I don't get the error while running on my machine. The error talks about an input that was provided "http://::1/" and I have no idea why.

My versions are

cypress-ntlm-auth: 4.1.5 cypress: 13.7.0

bjowes commented 3 months ago

This error comes from the fact that localhost is resolved differently on different systems. It used to be 127.0.0.1 but as IPv6 is slowly getting more adoption it is changing to ::1 on some systems. Which OS is Jenkins running on?

In this particular case, it seems that the NO_PROXY environment variable is set before cypress-ntlm is launched, and it contains the ::1 string. Check the contents of NO_PROXY, there may be something there you want to preserve. You could try setting NO_PROXY manually to blank before starting cypress-ntlm.

A proper fix would require that the ::1 string is detected by cypress-ntlm and that is it escaped as [::1] - this is already implemented in other areas of cypress-ntlm.

sham-christopher commented 3 months ago

Thanks a lot. That fixed the issue. I have another one but I will raise it in another.