#358931 Invalid entries in sources.list not recognized

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Damyan Ivanov
Date:
2025-06-07 18:55:02 UTC
Severity:
minor
#358931#5
Date:
2006-03-25 11:01:01 UTC
From:
To:
Hi, Eric,

apt 0.4.1 seems to use full request URI's that approx fails to parse
correctly. Example follows: (wraps all over the place)


Older apt (apt 0.5.28.6, aptitude 0.2.15.9-2):

Mar 25 12:47:31 shrek approx: Connection from 10.0.1.10:56367
Mar 25 12:47:31 shrek approx: Request
/debian/pool/main/p/python-cjkcodecs/python2.3-cjkcodecs_1.1.1-1_i386.deb
Mar 25 12:47:31 shrek approx:   Host: proxy:9999
Mar 25 12:47:31 shrek approx:   Connection: keep-alive
Mar 25 12:47:31 shrek approx:   User-Agent: Debian APT-HTTP/1.3
Mar 25 12:47:31 shrek approx:
debian/pool/main/p/python-cjkcodecs/python2.3-cjkcodecs_1.1.1-1_i386.deb
Mar 25 12:47:31 shrek approx:   414380 minutes old
Mar 25 12:47:31 shrek approx:   ims Thu, 01 Jan 1970 00:00:00 GMT  mtime
Thu, 02 Sep 2004 15:17:17 GMT
Mar 25 12:47:31 shrek approx: Cache hit
Mar 25 12:47:31 shrek approx:   Content-Type: text/plain
Mar 25 12:47:31 shrek approx:   Content-Length: 617964
Mar 25 12:47:31 shrek approx:   Last-Modified: Thu, 02 Sep 2004 15:17:17
GMT


Newer apt (apt 0.6.43.3, aptitude 0.4.1-1):

Mar 25 12:45:19 shrek approx: Connection from 192.168.110.32:45923
Mar 25 12:45:19 shrek approx: Request
http://proxy:9999.creditreform.bg/security/dists/sarge/updates/contrib/binary-i386/Packages.gz
Mar 25 12:45:19 shrek approx:   Host: proxy:9999
Mar 25 12:45:19 shrek approx:   Cache-Control: max-age=0
Mar 25 12:45:19 shrek approx:   If-Modified-Since: Fri, 26 Aug 2005
05:56:17 GMTMar 25 12:45:19 shrek approx:   User-Agent: Debian
APT-HTTP/1.3
Mar 25 12:45:19 shrek approx: no remote repository found for http:


As you can see, newer apt uses full URI in the request, including
scheme://<host:port> while older apt omits the scheme://host:port part.

It seems approx does not understand full URIs and assumes everithing up
to the first slash ("http:") is repository name.

I can try to fix this locally and propose a patch, but my Ocaml skills
are non-existing and I don't expect miracles :)


Thank you for writing approx.


dam

#358931#10
Date:
2006-03-25 17:27:09 UTC
From:
To:
I can't reproduce this (I'm using apt 0.6.43.3 from etch).
Is there anything else in your setup that's different?
"http://proxy.creditreform.bg:9999/..."?  But you're correct that
approx doesn't expect a full URI, so I'll fix that.

#358931#15
Date:
2006-03-25 19:22:44 UTC
From:
To:
retitle 358931 Invalid entries in sources.list not recognized
reassign 358931 apt
severity 358931 minor
thanks

APT maintainers, please read below for reason why I consider this a bug
in APT.


Eric Cooper wrote:

Ooops. My mistake. I am so blind, sorry for wasting your time :(
My sources.list was mismatched with a line like

    deb http://proxy:9999.creditreform.bg/security

After correcting it, Everything works as expected and Requests in syslog
on approx host seem exactly the same like if requesting with older apt
i.e. No full URIs are displayed.

So while approx may not recognize full URIs, the problem at hand was in
apt not reporting sources.list line as incorrect. Bug reassigned.

#358931#30
Date:
2025-06-07 18:47:13 UTC
From:
To:
Hi!
are parsed. I have testes the behaviour of apt 3.0.2 from trixie/sid.




A. Info about a test machine

root@debian:~# grep CODENAME /etc/os-release
VERSION_CODENAME=trixie

root@debian:~# apt --version
apt 3.0.2 (amd64)

root@debian:~# cat /etc/apt/sources.list | grep -v "#"
deb [trusted=yes] http://proxy:9999.creditreform.bg/12 ./




B. Test with "proxy" host not available

root@debian:~# apt-get -o "Debug::Acquire::http=true" update
Ign:1 http://proxy:9999/12 ./ InRelease
Ign:1 http://proxy:9999/12 ./ InRelease
Ign:1 http://proxy:9999/12 ./ InRelease
Err:1 http://proxy:9999/12 ./ InRelease
   Could not resolve 'proxy'
Reading package lists... Done
W: Failed to fetch http://proxy:9999/12/./InRelease  Could not resolve 'proxy'
W: Some index files failed to download. They have been ignored, or old ones used instead.




C. Test with "proxy" host available in local network. The host is running
a http server that listens on port 9999.

root@debian:~# grep proxy /etc/hosts
10.0.0.237 proxy

root@debian:~# ip --brief addr
lo               UNKNOWN        127.0.0.1/8 ::1/128
ens3             UP             10.0.0.57/8 fe80::201:2ff:fe01:202/64

root@debian:~# apt-get -o "Debug::Acquire::http=true" update
0% [Working]GET /12/./InRelease HTTP/1.1
Host: proxy:9999
Cache-Control: max-age=0
Accept: text/*
User-Agent: Debian APT-HTTP/1.3 (3.0.2)


Answer for: http://proxy:9999/12/./InRelease
HTTP/1.1 404 Not Found
Server: nginx/1.22.1
Date: Sat, 07 Jun 2025 13:22:33 GMT
Content-Type: text/html
Content-Length: 153
Connection: keep-alive

Ign:1 http://proxy:9999/12 ./ InRelease
0% [Working]GET /12/./Release HTTP/1.1
Host: proxy:9999
Cache-Control: max-age=0
Accept: text/*
If-Modified-Since: Tue, 08 Apr 2025 18:11:40 GMT
User-Agent: Debian APT-HTTP/1.3 (3.0.2)


Answer for: http://proxy:9999/12/./Release
HTTP/1.1 304 Not Modified
Server: nginx/1.22.1
Date: Sat, 07 Jun 2025 13:22:33 GMT
Last-Modified: Tue, 08 Apr 2025 18:11:40 GMT
Connection: keep-alive
ETag: "67f566dc-e4"

Hit:2 http://proxy:9999/12 ./ Release
0% [Working]GET /12/./Release.gpg HTTP/1.1
Host: proxy:9999
User-Agent: Debian APT-HTTP/1.3 (3.0.2)


Answer for: http://proxy:9999/12/./Release.gpg
HTTP/1.1 404 Not Found
Server: nginx/1.22.1
Date: Sat, 07 Jun 2025 13:22:33 GMT
Content-Type: text/html
Content-Length: 153
Connection: keep-alive

Ign:3 http://proxy:9999/12 ./ Release.gpg
Reading package lists... Done




My understanding is that apt's parser doesn't recognize the dot after
"9999" as a character that is unexpected at this position (after a port
number), and instead it discards everything after the port number,
until a first '/' character.

Kamil