flatpak / flatpak-builder-tools

Various helper tools for flatpak-builder
191 stars 104 forks source link

Playwright firefox error #408

Open bestlinuxgamers opened 2 months ago

bestlinuxgamers commented 2 months ago

flatpak-builder version

1.4.1

Linux distribution and version

Ubuntu 23.04

Affected flatpak-builder tool

node/flatpak-node-generator.py

flatpak-builder tool cli args

No response

Source repository URL

https://github.com/janhq/jan.git

Flatpak-builder manifest URL

No response

Description

There seems to be an issue with the playwright Firefox download. It uses https://playwright.azureedge.net/builds/firefox/1447/firefox-ubuntu-18.04.zip, but should use https://playwright.azureedge.net/builds/firefox/1447/firefox-ubuntu-22.04.zip This code seems to cause the issue: https://github.com/flatpak/flatpak-builder-tools/blob/master/node/flatpak_node_generator/providers/special.py#L359

Stack trace:

Generating packages [6051/6052] esbuild @ 0.19.12                                                                                                                                                                                             
Traceback (most recent call last):
  File "/root/.local/bin/flatpak-node-generator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/main.py", line 277, in main
    asyncio.run(_async_main())
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/main.py", line 229, in _async_main
    await progress.run()
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/progress.py", line 78, in run
    await coro
  File "/usr/lib/python3.12/asyncio/tasks.py", line 631, in _wait_for_one
    return f.result()  # May raise f.exception().
           ^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/progress.py", line 68, in _generate
    await self.module_provider.generate_package(package)
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/providers/yarn.py", line 171, in generate_package
    await self.special_source_provider.generate_special_sources(package)
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/providers/special.py", line 482, in generate_special_sources
    await self._handle_playwright(package)
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/providers/special.py", line 373, in _handle_playwright
    metadata = await RemoteUrlMetadata.get(dl_url, cachable=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/url_metadata.py", line 41, in get
    async for part in Requests.instance.read_parts(url, cachable=False):
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/requests.py", line 57, in read_parts
    async for part in self._read_parts(url, size):
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/requests.py", line 30, in _read_parts
    async with self._open_stream(url) as stream:
  File "/usr/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/flatpak_node_generator/requests.py", line 24, in _open_stream
    async with session.get(url) as response:
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/aiohttp/client.py", line 696, in _request
    resp.raise_for_status()
  File "/root/.local/share/pipx/venvs/flatpak-node-generator/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='The specified blob does not exist.', url=URL('https://playwright.azureedge.net/builds/firefox/1447/firefox-ubuntu-18.04.zip')
hexchain commented 4 weeks ago

It seems they actually have a lot of possible builds, and newer firefox doesn't seem to be available with ubuntu18.04: https://github.com/microsoft/playwright/blob/f17d0440a7d1765412290947e5965c9a599c4835/packages/playwright-core/src/server/registry/index.ts#L77

But I can't find which type of build appears after which revision.