Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve resilience to broken zkg.meta when aggregating a package source #141

Open
ckreibich opened this issue Oct 19, 2022 · 0 comments
Open

Comments

@ckreibich
Copy link
Member

It'd be good to handle this more gracefully: https://github.com/zeek/packages/actions/runs/3274626082/jobs/5388405156

Copied for reference:

2022-10-18 15:07:00 DEBUG    init Manager version 2.13.0
2022-10-18 15:07:00 DEBUG    creating source clone of "zeek" at /home/runner/.zkg/clones/source/zeek
2022-10-18 15:07:00 DEBUG    refresh "zeek": pulling ***github.com/zeek/packages
2022-10-18 15:07:01 DEBUG    aggegrate file in source unchanged, restore local one
Refresh package source: zeek
Traceback (most recent call last):
  File "/home/runner/.local/bin/zkg", line 2770, in <module>
    main()
  File "/home/runner/.local/bin/zkg", line 2767, in main
    args.run_cmd(manager, args, config, configfile)
  File "/home/runner/.local/bin/zkg", line 1189, in cmd_refresh
    res = manager.aggregate_source(source, args.push)
  File "/home/runner/.local/lib/python3.8/site-packages/zeekpkg/manager.py", line 865, in aggregate_source
    return self._refresh_source(name, True, push)
  File "/home/runner/.local/lib/python3.8/site-packages/zeekpkg/manager.py", line 1006, in _refresh_source
    invalid_reason = _parse_package_metadata(
  File "/home/runner/.local/lib/python3.8/site-packages/zeekpkg/manager.py", line 2992, in _parse_package_metadata
    if not parser.read(metadata_file):
  File "/usr/lib/python3.8/configparser.py", line 697, in read
    self._read(fp, filename)
  File "/usr/lib/python3.8/configparser.py", line 1082, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: '/home/runner/.zkg/scratch/zeek-outbound-known-services-with-origflag/zkg.meta', line: 1
'package]\n'

It'd also be good to do basic package sanity checking at the zkg level when adding a package to the default source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant