Bug 260699 - lang/php74: www.php.net blocks "fetch libfetch/2.0" user-agent
Summary: lang/php74: www.php.net blocks "fetch libfetch/2.0" user-agent
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Torsten Zuehlsdorff
URL:
Keywords: honeypot
Depends on:
Blocks:
 
Reported: 2021-12-26 13:37 UTC by Christos Chatzaras
Modified: 2024-08-30 05:22 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (tz)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christos Chatzaras 2021-12-26 13:37:28 UTC
This is what I get when I try to upgrade PHP from 7.4.26 to 7.4.27 using FreeBSD ports:

=> php-7.4.27.tar.xz doesn't seem to exist in /usr/ports/distfiles//.
=> Attempting to fetch https://www.php.net/distributions/php-7.4.27.tar.xz
fetch: https://www.php.net/distributions/php-7.4.27.tar.xz: Service Unavailable
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/php-7.4.27.tar.xz
fetch: http://distcache.FreeBSD.org/ports-distfiles/php-7.4.27.tar.xz: Not Found
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles// and try again.

FreeBSD ports uses "fetch" to download https://www.php.net/distributions/php-7.4.27.tar.xz but looks like www.php.net web-server blocks user agent "fetch libfetch/2.0" and returns "Service Unavailable".

----

I submit a bug report here too:

https://github.com/php/php-src/issues/7833
Comment 1 Denis Shaposhnikov 2021-12-26 16:02:18 UTC
Me too

❯ fetch https://www.php.net/distributions/php-7.4.27.tar.xz
fetch: https://www.php.net/distributions/php-7.4.27.tar.xz: Service Unavailable
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2021-12-26 16:15:59 UTC
(In reply to Christos Chatzaras from comment #0)
No it apparently blocks fetch somehow. I have tried fetch with so many --user-agent string without any fruitful result.

For now you can do:

sed -i '' -e 's|PHP/distributions|LOCAL/bofh|g’ /usr/ports/lang/php74/Makefile

While me and tz@ are working on a permanent fix.
Comment 3 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2021-12-26 16:16:51 UTC
(In reply to Muhammad Moinur Rahman from comment #2)
By the by my hack is also applicable for php73 and php80 too as I have cached the distfiles.
Comment 4 Christos Chatzaras 2021-12-26 16:23:11 UTC
I use wget to download the file inside /usr/ports/distfiles
Comment 5 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2021-12-26 16:28:20 UTC
In case someone needs to follow look like someone has already submitted an issue:

https://github.com/php/web-php/issues/483
Comment 6 Christos Chatzaras 2021-12-26 16:36:27 UTC
(In reply to Muhammad Moinur Rahman from comment #5)

Yes this was me.
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-12-26 18:27:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=529117f533a514559415cae1128f90c4c8f131c4

commit 529117f533a514559415cae1128f90c4c8f131c4
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2021-12-26 18:08:49 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2021-12-26 18:23:22 +0000

    Fix fetch for php*

    - Primary hosting provider of php has introduced some sort of checking
      which is blocking fetch although curl/wget works perfectly. fetch with
      other --user-agent is also not working at the moment. An issue has been
      opened with the upstream which can be found at:
      https://github.com/php/web-php/issues/483
    - Untill this is fixed add php Github distributions URL to MASTER_SITES
    - Modify MASTER_SITES for php[73|74|80] and remove SUBDIR as it affects
      DIST_SUBDIR
    - Add DIST_SUBDIR as Github is IPv4 only which affects IPv6 only
      builders. In case someone is running IPv6 only builders distcache will
      pickup and serve.
    - Although distinfo has been updated as we have added DIST_SUBDIR but
      SHA256 and SIZE are unchanged. In case someone needs to verify those
      are available from https://www.php.net/downloads
    - We might have done some drastic changes but we are on the brink of
      quarterly build and we do not want to start a new year and a new
      quarter with BROKEN php and thousands of other ports.

    PR: 260699
    Reported by: chris@cretaforce.gr
    Approved by: portmgr (blanket infrastructure)
    Sponsored by: Bounce Experts

 Mk/bsd.sites.mk     | 5 ++++-
 lang/php73/Makefile | 3 ++-
 lang/php73/distinfo | 6 +++---
 lang/php74/Makefile | 3 ++-
 lang/php74/distinfo | 6 +++---
 lang/php80/Makefile | 3 ++-
 lang/php80/distinfo | 6 +++---
 7 files changed, 19 insertions(+), 13 deletions(-)
Comment 8 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2021-12-26 18:29:42 UTC
For now the fetch should start working again but we will keep this open to followup with the upstream issue.
Comment 9 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2021-12-26 19:52:40 UTC
The problem is related to http1.1 and http2. In case we try curl with --http1.1 it also fails with the same errors. I believe fetch do not have http2 support.
Comment 10 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-02-23 18:51:34 UTC
Looks like this has been fixed by upstream and no changes are needed from our side. As a failproof mechanism we will keep using Github distfiles too in addition to original upstream MASTER_SITES.
Comment 11 Tiny Wee 2022-04-25 02:26:37 UTC
MARKED AS SPAM
Comment 12 carlseoservices 2024-06-10 20:49:49 UTC
MARKED AS SPAM