Package install errors - How to resolve after SWI-Prolog changed to using HTTPS

Posting this info here so that it can be indexed by search engines and more easily found.

Recently SWI-Prolog switched to using HTTPS which broke some things for older versions of SWI-Prolog (pre 8.0.3), namely the ability to install packages.

Here are examples of the errors:

Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.0)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- pack_install(list_util).
% Contacting server at http://www.swi-prolog.org/pack/query ...
ERROR: url `'https://www.swi-prolog.org/pack/query'' does not exist (status(500,Internal Server Error))
ERROR: In:
ERROR:   [18] throw(error(existence_error(url,'https://www.swi-prolog.org/pack/query'),context(_8290,...)))
ERROR:   [16] http_open:try_http_proxy(direct,[uri('http://www.swi-prolog.org/pack/query'),...|...],_8326,[post(...),...]) at c:/program files/swipl/library/http/http_open.pl:425
ERROR:   [14] <meta call>
ERROR:   [13] '$sig_atomic'(prolog_pack:http_open('http://www.swi-prolog.org/pack/query',_8420,...)) <foreign>
ERROR:   [12] setup_call_catcher_cleanup(prolog_pack:http_open('http://www.swi-prolog.org/pack/query',_8464,...),prolog_pack:read_reply(_8476,_8478,_8480),_8450,prolog_pack:close(_8490)) at c:/program files/swipl/boot/init.pl:467
ERROR:   [10] prolog_pack:query_pack_server(locate(list_util),_8522,[]) at c:/program files/swipl/library/prolog_pack.pl:1719
ERROR:    [9] prolog_pack:pack_default_options(list_util,list_util,[],_8564) at c:/program files/swipl/library/prolog_pack.pl:516
ERROR:    [8] prolog_pack:pack_install(list_util) at c:/program files/swipl/library/prolog_pack.pl:457
ERROR:    [7] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
?- 

?- pack_list(X).
% Contacting server at http://www.swi-prolog.org/pack/query ...
ERROR: url `'https://www.swi-prolog.org/pack/query'' does not exist (status(500,Internal Server Error))
ERROR: In:
ERROR:   [18] throw(error(existence_error(url,'https://www.swi-prolog.org/pack/query'),context(_1278,...)))
ERROR:   [16] http_open:try_http_proxy(direct,'<garbage_collected>','<garbage_collected>','<garbage_collected>') at c:/program files/swipl/library/http/http_open.pl:425
ERROR:   [14] <meta call>
ERROR:   [13] '$sig_atomic'(prolog_pack:http_open('http://www.swi-prolog.org/pack/query',_1376,...)) <foreign>
ERROR:   [12] setup_call_catcher_cleanup('<garbage_collected>',prolog_pack:read_reply(_1418,_1420,_1422),_1406,prolog_pack:close(_1432)) at c:/program files/swipl/boot/init.pl:467
ERROR:   [10] prolog_pack:query_pack_server('<garbage_collected>',_1464,[]) at c:/program files/swipl/library/prolog_pack.pl:1719
ERROR:    [9] prolog_pack:pack_search(_1496) at c:/program files/swipl/library/prolog_pack.pl:365
ERROR:    [7] <user>
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
?- 

To resolve these errors SWI-Prolog needs to be upgraded.

While most users work on Unix, I use Windows and will demonstrate this using Windows.

Uninstall SWI-Prolog

  1. Close all running instances of SWI-Prolog.
  2. Locate Uninstall.exe for SWI-Prolog. On my system it is located in C:\Program Files\swipl
  3. Run Uninstall.exe and respond to prompts.
  4. Verify that the SWI-Prolog directory is empty. Delete any remaining files manually.

Install latest version of SWI-Prolog

  1. Navigate to https://www.swi-prolog.org/Download.html
  2. Click Stable release
  3. Click SWI-Prolog 8.0.3-1 for Microsoft Windows (64 bit). This will start a download.
  4. When download completes run swipl-8.0.3-1.x64.exe. On my system it is located in C:\Users\Eric\Downloads
  5. Start SWI-Prolog
Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.3)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

Query and install of packages should work.

?- pack_list(list_util).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
p list_util@0.13.0          - Predicates for working with lists
true.

?- pack_install(list_util).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Select download location for list_util@0.13.0
   (1) * GIT repository at https://github.com/mndrix/list_util.git
   (2)   https://github.com/mndrix/list_util/archive/v0.13.0.zip
   (3)   Cancel

Your choice? 1
% Cloning into 'c:/users/eric/appdata/roaming/swi-prolog/pack/list_util'...
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "list_util.git" was downloaded 67 times
Package:                list_util
Title:                  Predicates for working with lists
Installed version:      0.13.0
Author:                 Michael Hendricks <michael@ndrix.org>
Maintainer:             Michael Hendricks <michael@ndrix.org>
Packager:               Michael Hendricks <michael@ndrix.org>
Home page:              https://github.com/mndrix/list_util
Download URL:           https://github.com/mndrix/list_util/archive/v0.13.0.zip
Activate pack "list_util" Y/n? 
true.
1 Like

Do you want to pin this for a few weeks?

1 Like