Recent

Author Topic: Online Package Manager  (Read 835872 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Online Package Manager
« Reply #960 on: September 27, 2017, 09:53:18 am »
When behind a firewall, I get "Cannot download package list. Error message: Unexpected response status code: 407" and GUI says "No packages to show". For OPM I use the same proxy settings as in browser and I have checked proxy IP address, port, username and password many times, so I don't get it why proxy does not let OPM authenticate. From browser I can access without problems both http://packages.lazarus-ide.org and https://packages.lazarus-ide.org and download packages by hand. Was there a known bug with proxy access fixed in some newer version? That seams to be my best chance right now.

That Lazarus was made with fpcupdeluxe (FPC and LAZ trunks on May 17th) that had OPM working and updating on original pc with internet access without proxy, and now copied to the same dir on target pc but behind proxy.

View / IDE Internals / About FPC:
Lazarus version: 1.9.0
Lazarus svn revision: 54956M
Lazarus build date: 2017/05/17
Lazarus was compiled for i386-win32
Lazarus was compiled with fpc 3.1.1
« Last Edit: September 27, 2017, 09:55:15 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #961 on: September 27, 2017, 12:11:57 pm »
Hi avra,

In order to test if is a fpc bug or not, please try following code(change Host, Port, UserName and Password):
Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Classes,
  10.   fphttpclient
  11.   { you can add units after this };
  12.  
  13.  
  14. var
  15.   FHTTPClient: TFPHTTPClient;
  16. begin
  17.   FHTTPClient := TFPHTTPClient.Create(nil);
  18.   try
  19.     FHTTPClient.Proxy.Host:= 'Host';
  20.     FHTTPClient.Proxy.Port:= 8080;
  21.     FHTTPClient.Proxy.UserName:= 'user';
  22.     FHTTPClient.Proxy.Password:= 'pass';
  23.     FHTTPClient.Get('http://packages.lazarus-ide.org/packagelist.json', 'packagelist.json');
  24.     if FHTTPClient.ResponseStatusCode = 200 then
  25.       Writeln('Successfully downloaded')
  26.     else
  27.       Writeln('Cannot download file!');
  28.     Readln;
  29.   finally
  30.     FHTTPClient.Free;
  31.    end;
  32. end.

Thank you.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Online Package Manager
« Reply #962 on: September 27, 2017, 02:17:16 pm »
In order to test if is a fpc bug or not, please try following code(change Host, Port, UserName and Password)
Thank you for your attention. If I literally copy/paste (and change host, ip, user and password) then this is the result:
Code: Pascal  [Select][+][-]
  1. An unhandled exception occurred at $00420979:
  2. EHTTPClient: Unexpected response status code: 407
  3.   $00420979
  4.   $00421341
  5.   $00421645
  6.   $00421BE5
  7.   $00421DB7
  8.   $00421E12
  9.   $00401850  main,  line 23 of project1.lpr
If I wrap try..except around HTTP GET command like this:
Code: Pascal  [Select][+][-]
  1.     try
  2.       FHTTPClient.Get('http://packages.lazarus-ide.org/packagelist.json', 'packagelist.json');
  3.     except
  4.       WriteLn('Exception catched');
  5.     end;
then the result is this:
Code: Pascal  [Select][+][-]
  1. Exception catched
  2. Cannot download file!
I can download that JSON file from the browser. I have checked ip, port, username and password many times and they are good.

UPDATE: If I enter empty strings for username and password the result is the same as above.
« Last Edit: September 27, 2017, 02:20:46 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #963 on: September 27, 2017, 02:50:39 pm »
It looks like an FPC bug.  %) I will run a few more test later.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #964 on: September 28, 2017, 09:41:28 am »
@avra

What kind of proxy do you have? I ran a few test and unfortunately socks protocol is not supported/implemented in fpc(SOCKS4, SOCKS4a, SOCKS5), however HTTP proxy works well, I tested with and without password.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Online Package Manager
« Reply #965 on: September 28, 2017, 06:38:26 pm »
What kind of proxy do you have?
According to IE it's http proxy. Now I am puzzled. It must be something on my side but I don't know what...
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #966 on: September 28, 2017, 08:11:53 pm »
Quote
According to IE it's http proxy. Now I am puzzled. It must be something on my side but I don't know what...
Firewall maybe? Try to add Lazarus to the whitelist.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Online Package Manager
« Reply #967 on: September 29, 2017, 03:29:43 pm »
Quote
According to IE it's http proxy. Now I am puzzled. It must be something on my side but I don't know what...
Firewall maybe? Try to add Lazarus to the whitelist.
"Windows Firewall is using your domain settings". Although it seams that domain policy has changed recently, adding exceptions is allowed. Unfortunatelly it didn't help. I give up. Thanks for your effort.
 :'(
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #968 on: September 29, 2017, 05:21:07 pm »
@avra
You can still use OPM if you have a http server installed on your local computer, where no proxy is needed. If yes, please do the following:
1. Download the main repository from here: https://packages.lazarus-ide.org/opm.zip  (182 Mb)
2. Extract the zip to a folder, "packages" for example
3. Start the local server
4. Start OPM, go to Options-->Genereal-->Remote repository, click the "..." button, then add the following address: http://localhost/packages/  Close the dialog, select the local server, then click "OK"

Every time I update the main repository, I will also update the opm.zip file. Each time you wish to get the latest packages, you have to download and extract opm.zip. Still much better then installing manually 10-15 packages.
« Last Edit: September 29, 2017, 05:30:34 pm by GetMem »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Online Package Manager
« Reply #969 on: October 02, 2017, 08:53:41 am »
Download the main repository from here: https://packages.lazarus-ide.org/opm.zip  (182 Mb)
Thank you so much!  :D  8-)
I will download that from home and then try here.  ;)  :-X
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Online Package Manager
« Reply #970 on: October 02, 2017, 01:27:30 pm »
I want to publish ATTabs - https://github.com/alexey-t/attabs , what files must I send?

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #971 on: October 02, 2017, 01:36:57 pm »
@Alextp
I will add ATTabs soon to the main repository.

AlexTP

  • Hero Member
  • *****
  • Posts: 2384
    • UVviewsoft
Re: Online Package Manager
« Reply #972 on: October 02, 2017, 02:35:58 pm »
Suggestion
- now we have "yellow box with green +" icons for all old packages
- wish: make it monotone: yellow box. its better.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Online Package Manager
« Reply #973 on: October 02, 2017, 03:56:51 pm »
I was just opening OPM from today's Laz trunk / fpc 3.02 and get the error "Cannot download package list. Error messge: 'Connect to packages.lazarus-ide.org:80 failed'. Trying to do the same with Laz 1.8RC4 works correctly.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #974 on: October 02, 2017, 07:39:05 pm »
@Alextp
I added ATTabs to the main repository. Thank you for submitting the component.

Quote
Suggestion
- now we have "yellow box with green +" icons for all old packages
- wish: make it monotone: yellow box. its better.
OPM has to distinguish between the 3 package type(meta package, new meta package and  lazarus package). See attachment. If the meta package icon is yellow, one can confuse it with a lazarus package.

 

TinyPortal © 2005-2018