flatpak / flatpak-builder-tools

Various helper tools for flatpak-builder
198 stars 107 forks source link

flatpak-node-generator fails unexpectedly #278

Closed kfiven closed 2 years ago

kfiven commented 2 years ago

flatpak-builder version

1.2.2

Linux distribution and version

Ubuntu 20.04

Affected flatpak-builder tool

node/flatpak-node-generator.py

flatpak-builder tool cli args

No response

Source repository URL

https://github.com/cinnyapp/cinny-desktop/releases/download/v2.0.0/cinny-desktop-v2.0.0.zip

Flatpak-builder manifest URL

No response

Description

python3 ./flatpak-node-generator.py npm -r ~/Downloads/hello-flat/src/cinny-desktop/package-lock.json gives

Traceback (most recent call last):

 File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 2027, in <module>
    [asyncio.run](http://asyncio.run/)(main())
  File "/usr/lib/python3.8/asyncio/[runners.py](http://runners.py/)", line 44, in run
    return [loop.run](http://loop.run/)_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1985, in main
    await [progress.run](http://progress.run/)()
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1809, in run
    await coro
  File "/usr/lib/python3.8/asyncio/[tasks.py](http://tasks.py/)", line 619, in _wait_for_one
    return f.result()  # May raise f.exception().
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1799, in _generate
    await self.module_provider.generate_package(package)
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1458, in generate_package
    size = await RemoteUrlMetadata.get_size(source.resolved, cachable=True)
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 533, in get_size
    bucket_reader = [bucket.open](http://bucket.open/)_read()
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 270, in open_read
    fp = self._cache_path.open('rb')
  File "/usr/lib/python3.8/[pathlib.py](http://pathlib.py/)", line 1222, in open
    return [io.open](http://io.open/)(self, mode, buffering, encoding, errors, newline,
  File "/usr/lib/python3.8/[pathlib.py](http://pathlib.py/)", line 1078, in _opener
    return self._accessor.open(self, flags, mode)
OSError: [Errno 24] Too many open files: '/home/user/.cache/flatpak-node-generator/remote-url-metadata_3Asize_3Ahttps_3A_2F_2Fregistry.npmjs.org_2Fis-plain-object_2F-_2Fis-plain-object-5.0.0.tgz'

python3 ./flatpak-node-generator.py npm -r ~/Downloads/hello-flat/src/cinny-desktop/package-lock.json --no-aiohttp gives

Traceback (most recent call last):
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 2027, in <module>
    [asyncio.run](http://asyncio.run/)(main())
  File "/usr/lib/python3.8/asyncio/[runners.py](http://runners.py/)", line 44, in run
    return [loop.run](http://loop.run/)_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1985, in main
    await [progress.run](http://progress.run/)()
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1809, in run
    await coro
  File "/usr/lib/python3.8/asyncio/[tasks.py](http://tasks.py/)", line 619, in _wait_for_one
    return f.result()  # May raise f.exception().
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1799, in _generate
    await self.module_provider.generate_package(package)
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1453, in generate_package
    source = await self.resolve_source(package)
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 1411, in resolve_source
    raw_data = await [Requests.instance.read](http://requests.instance.read/)_all(data_url, cachable=False)
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 355, in read_all
    data = await self._read_all(url)
  File "./[flatpak-node-generator.py](http://flatpak-node-generator.py/)", line 382, in _read_all
    with urllib.request.urlopen(url) as response:
  File "/usr/lib/python3.8/urllib/[request.py](http://request.py/)", line 222, in urlopen
    return [opener.open](http://opener.open/)(url, data, timeout)
  File "/usr/lib/python3.8/urllib/[request.py](http://request.py/)", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/[request.py](http://request.py/)", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/[request.py](http://request.py/)", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/[request.py](http://request.py/)", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/[request.py](http://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
mijorus commented 2 years ago

same issue here, --no-aiohttp fixes it but it's a lot slower