Recent

Author Topic: New Online Package manager in 1.8 and Proxy issues  (Read 7030 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
New Online Package manager in 1.8 and Proxy issues
« on: January 09, 2018, 05:39:13 pm »
Is anyone using the online package manager behind a corporate proxy?

I used the same proxy setup I use for TortoiseSVN (which works) and the online package manager fails with error:

"Cannot download package list.  Error message:
"unexpected response code:407"
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

balazsszekely

  • Guest
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #2 on: January 09, 2018, 06:42:47 pm »
To make a long story short, for downloading files, OPM uses the "built in" fphttpclient available in fpc. Fphttpclient does support proxy but only html proxy(no SOCKS4, SOCKS4a, SOCKS5, etc...). If that's not an option then please read this post: https://forum.lazarus-ide.org/index.php/topic,34297.msg261082.html#msg261082 (similar to @avra's link).

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #3 on: January 09, 2018, 07:07:28 pm »
It's just a standard HTTP proxy, that's why I mentioned TortiseSVN works and that also only supports http proxy.
based on that thread from sept it looks like it might be a bug with FPC?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

balazsszekely

  • Guest
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #4 on: January 09, 2018, 07:25:02 pm »
If you use a stable FPC, 3.0.4 for example, then it should work. OPM has a local copy of fphttpclient and the issue is fixed there. AFAIK it's still not fixed in the trunk, although I did not checked lately.

PS: I just realized the fix was never merged back to 1.8. Most likely this is why you cannot connect to the proxy server. Please do the following:
1. Open file $(LazarusDir)/components/onlinepackagemanger/fpcmod/opkman_httpclient
2. Go to function GetProxyHeaders
3. Change line
Code: Pascal  [Select][+][-]
  1. Result:='Proxy-Authorization: Basic ' + EncodeStringBase64(UserName+':'+UserName);
with
Code: Pascal  [Select][+][-]
  1. Result:='Proxy-Authorization: Basic ' + EncodeStringBase64(UserName+':'+Password);
Re-compile OPM, rebuild IDE and try again.
« Last Edit: January 09, 2018, 07:44:01 pm by GetMem »

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #5 on: January 10, 2018, 01:54:13 am »
LOL,looks like it was one of those copy and paste bugs :-)
Thanks for looking into it,will check it out in the morning.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11351
  • FPC developer.
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #6 on: January 10, 2018, 07:31:48 am »
That fix is from december and thus not in 3.0.4

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #7 on: January 10, 2018, 04:42:22 pm »
made that change and it still does not work.
I recompiled the package and rebuilt IDE, that did not work, so I then uninstalled the package completely and reinstalled but same error.

Does the file in the FPCMOD folder need to be copied into the main package dir?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

balazsszekely

  • Guest
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #8 on: January 10, 2018, 04:51:08 pm »
Quote
made that change and it still does not work.
I recompiled the package and rebuilt IDE, that did not work, so I then uninstalled the package completely and reinstalled but same error.
Unfortunately I have no idea why is not working at your side. I did run a few tests in my local computer and works fine. You should debug it to find out the reason.

Quote
Does the file in the FPCMOD folder need to be copied into the main package dir?
No.

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #9 on: January 12, 2018, 04:03:35 pm »
well, I gave up with the corp proxy, just does not work.
Maybe I can try the test code and convert it to synapse and see if it works there.

On another note I did use the package manager at home and it worked flawlessly, easiest install of Indy 10 ever :-)
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

balazsszekely

  • Guest
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #10 on: January 12, 2018, 04:05:48 pm »
@snorkel
Do you have the possibility to install a local http server on your computer? If yes then I have a solution for you, you can use OPM locally.
« Last Edit: January 12, 2018, 04:56:23 pm by GetMem »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #11 on: January 12, 2018, 04:49:58 pm »
@GetMem
Is it possible and easy to use OPM locally such as Apt-Cacher and Apt-Mirror for mirroring Debian and Ubuntu repositories?

----------------------------------------------------------------------------------------------------
Apt-Mirror
------------
The first method makes use of a tool called “apt-mirror”. It is a perl-based utility for downloading and mirroring the entire contents of a public repository. This may likely include packages that you don't use and will not use, but anything stored in a public repository will also be stored in your mirror.


Apt-Cacher
--------------
The second method of mirroring Ubuntu packages is through the use of a tool called Apt-Cacher.

Apt-Cacher differs from apt-mirror in that it does not mirror the entire repository contents, but simply caches (stores) any packages requested by clients within the network. In other words, it works as a middle man between the public repository and the LAN clients, sharing any common downloads internally.

Each time any client requests a package, whether it be a security update or a new application to install, the apt-cache server will request the package from the public repository, store it and pass it back to the original requesting client. The package is then made available to any future requests from the internal network.

This method is best suited for those with minimal storage availability, or those that may simply want to make updates more efficient.
---------------
https://www.packtpub.com/books/content/create-local-ubuntu-repository-using-apt-mirror-and-apt-cacher
https://www.howtoforge.com/local_debian_ubuntu_mirror
----------------------------------------------------------------------------------------------------

balazsszekely

  • Guest
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #12 on: January 12, 2018, 05:03:13 pm »
valdir.marcos
Quote
Is it possible and easy to use OPM locally such as Apt-Cacher and Apt-Mirror for mirroring Debian and Ubuntu repositories?
I'm afraid OPM wasn't designed to emulate Apt-Mirror or Apt-Cacher functionality.

Quote
This method is best suited for those with minimal storage availability, or those that may simply want to make updates more efficient.
OPM deals with Lazarus packages, typically 1-2 Mb in size(on average). If you install Lazarus to a computer, typically  1GB+, a few MB in plus makes no difference in my opinion.

Thaddy

  • Hero Member
  • *****
  • Posts: 14163
  • Probably until I exterminate Putin.
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #13 on: January 12, 2018, 05:08:30 pm »
Last time I used apt (today!) it lagged several major versions of the software I needed. (Fine with me unless it is security related)
Last time I used OPM everything was up-to-date!  :D :D :D :D

Don't get me wrong, but if even a "simple" Debian distribution (Jessie) can't keep up, why ask for the Holy Grail?
Even Ubuntu( also Debian based) lags...
« Last Edit: January 12, 2018, 05:12:48 pm by Thaddy »
Specialize a type, not a var.

WimVan

  • Jr. Member
  • **
  • Posts: 85
Re: New Online Package manager in 1.8 and Proxy issues
« Reply #14 on: January 17, 2019, 09:04:42 am »
@GetMem

Your suggestion to change OPN works fine.  Thanks.

 

TinyPortal © 2005-2018