beeware / mobile-forge

A tool to manage building cross-platform binary wheels for mobile devices
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

urllib.error.HTTPError: HTTP Error 404: Not Found #22

Closed idbeny closed 9 months ago

idbeny commented 9 months ago

Describe the bug

Shown error when executing forge iOS litesync-ios.

Steps to reproduce

  1. Create litesync-ios in recipes folder. And includes:

    • meta.yaml
      package:
      name: litesync-ios
      version: 0.0.1
    • opt
      • include/sqlite3.h
      • lib/liblitesync.a
  2. Executing command:

    forge iOS litesync-ios

Expected behavior

Successful build is like forge iOS lru-dict.

Screenshots

No response

Environment

Logs

[venv3.8-ios_12_0_iphonesimulator_x86_64] Download package sources
********************************************************************************
Failed build: litesync-ios 0.0.1 for iphonesimulator 12.0 on x86_64
********************************************************************************
Traceback (most recent call last):
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 266, in build
    self.prepare(clean=clean)
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 458, in prepare
    super().prepare(clean=clean)
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 175, in prepare
    self.download_source()
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 85, in download_source
    url = self.download_source_url()
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 455, in download_source_url
    return get_pypi_source_urls(self.package.name)[self.package.version]
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/pypi.py", line 59, in get_pypi_source_urls
    releases = get_pypi_releases(package_name)
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/pypi.py", line 19, in get_pypi_releases
    releases = json.load(urlopen(url, context=context))["releases"]
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Failed builds for:
 * litesync-ios (default version) (ios_12_0_iphoneos_arm64)
 * litesync-ios (default version) (ios_12_0_iphonesimulator_arm64)
 * litesync-ios (default version) (ios_12_0_iphonesimulator_x86_64)

Additional context

I don't know which step caused the problem.

idbeny commented 9 months ago

The problem is the same on mac's apple chip and inter chip.

freakboy3742 commented 9 months ago

I'm not sure what part of this message isn't obvious.

You're asking to build a package litesync-ios.

PyPI doesn't have a package called litesync-ios, so it's failing to download a source package.

If you want to build litesync... define a package called litesync.

idbeny commented 9 months ago

Oh, you are correct! But, now have new error:

================================================================================
Building litesync-ios 0.0.1 for ios_12_0_iphonesimulator_arm64
================================================================================

[venv3.8-ios_12_0_iphonesimulator_arm64] Download package sources
Downloading https://litesync.io/download/litesync-free-ios-native-libs.tar.gz...********************************************************************************
Failed build: litesync-ios 0.0.1 for iphonesimulator 12.0 on arm64
********************************************************************************
Traceback (most recent call last):
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
    yield
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_backends/sync.py", line 168, in start_tls
    raise exc
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_backends/sync.py", line 163, in start_tls
    sock = ssl_context.wrap_socket(
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/ssl.py", line 1073, in _create
    self.do_handshake()
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
socket.timeout: _ssl.c:1114: The handshake operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions
    yield
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 228, in handle_request
    resp = self._pool.handle_request(req)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_sync/connection_pool.py", line 268, in handle_request
    raise exc
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_sync/connection_pool.py", line 251, in handle_request
    response = connection.handle_request(request)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_sync/http_proxy.py", line 317, in handle_request
    stream = stream.start_tls(**kwargs)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_backends/sync.py", line 168, in start_tls
    raise exc
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectTimeout: _ssl.c:1114: The handshake operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 266, in build
    self.prepare(clean=clean)
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 331, in prepare
    super().prepare(clean=True)
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 175, in prepare
    self.download_source()
  File "/Users/ben/Work/Dev/Python/mobile-forge/src/forge/build.py", line 88, in download_source
    with httpx.stream("GET", url, follow_redirects=True) as response:
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_api.py", line 152, in stream
    with client.stream(
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_client.py", line 857, in stream
    response = self.send(
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_client.py", line 901, in send
    response = self._send_handling_auth(
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_client.py", line 929, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_client.py", line 966, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_client.py", line 1002, in _send_single_request
    response = transport.handle_request(request)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 228, in handle_request
    resp = self._pool.handle_request(req)
  File "/Users/ben/Work/Dev/Python/Python-Apple-support/install/macOS/macosx/python-3.8.18/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/ben/Work/Dev/Python/mobile-forge/venv3.8/lib/python3.8/site-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectTimeout: _ssl.c:1114: The handshake operation timed out
freakboy3742 commented 9 months ago

Again, I'm not sure what you're expecting someone to say here. This is an SSL error. It has nothing to do with Mobile Forge. A URL has been specified; it can't be downloaded because the SSL connection is failing. This could be for any number of reasons - but all of them are going be local conditions of your own setup - an old certificate configuration, a firewall, a badly configured proxy... it's impossible to know.

I'm happy to answer questions that are specific to configuring or using Mobile Forge - but when you get an error, you're expected to do some debugging yourself, not just throw every exception you get at the bug tracker.