Open mpal9000 opened 1 month ago
Thank you for your report.
github.com/aquaproj/aqua/v2/pkg/controller/generate/output.(*Outputter).generateInsert(0xc0000be980, {0xc0004245a0, 0x24}, {0xc00009e040, 0x1, 0x1})
/home/runner/work/aqua/aqua/pkg/controller/generate/output/insert.go:23 +0xc5
The panic occurs in the third party library goccy/go-yaml.
Other problems of the same dependency: https://github.com/aquaproj/aqua/issues/584 https://github.com/aquaproj/aqua/issues/585
This issue doesn't occur when I create aqua.yaml by aqua init
.
$ aqua init
$ cat aqua.yaml
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
# checksum:
# enabled: true
# require_checksum: true
# supported_envs:
# - all
registries:
- type: standard
ref: v4.239.1 # renovate: depName=aquaproj/aqua-registry
packages:
$ aqua g -i # choose 1xyz/pryrite
$ cat aqua.yaml
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
# checksum:
# enabled: true
# require_checksum: true
# supported_envs:
# - all
registries:
- type: standard
ref: v4.239.1 # renovate: depName=aquaproj/aqua-registry
packages:
- name: 1xyz/pryrite@0.10.20
Related: #584 #585
I don't think they are related. They are issues related to goccy/go-yaml, but they are different from this issue.
Yes that's what I meant, but I edited the comment. I wanted to link this one with the other two.
Hmm. I couldn't reproduce the issue.
$ aqua info
{
"version": "2.36.2",
"commit_hash": "716d9ac6f2de2beffe0db87caf418443155170ab",
"os": "darwin",
"arch": "arm64",
"pwd": "/Users/(USER)/Documents/test/aqua/3200",
"root_dir": "/Users/(USER)/.local/share/aquaproj-aqua",
"env": {
"AQUA_GLOBAL_CONFIG": ":/Users/(USER)/repos/src/github.com/aquaproj/aqua-registry/aqua-all.yaml",
"AQUA_PROGRESS_BAR": "true"
},
"config_files": [
{
"path": "/Users/(USER)/Documents/test/aqua/3200/aqua.yaml"
}
]
}
Set up local registry and policy.
$ cp ~/repos/src/github.com/aquaproj/aqua-registry/registry.yaml . # Copy registry.yaml from aqua-registry
$ cat aqua-policy.yaml
---
registries:
- name: local
type: local
path: registry.yaml
- type: standard
ref: semver(">= 3.0.0")
packages:
- registry: local # allow all packages in the Registry
- registry: standard
$ git init
$ aqua policy allow
Run aqua g -i
$ cat aqua.yaml
checksum:
supported_envs:
- linux
registries:
- type: local
name: local
path: registry.yaml
packages:
$ aqua g -i # choose 1xyz/pryrite
$ cat aqua.yaml
checksum:
supported_envs:
- linux
registries:
- type: local
name: local
path: registry.yaml
packages:
- name: 1xyz/pryrite@0.10.20
registry: local
I checked again because I saw about your try with aqua init
and actually it is a comment at the end that I omitted from the bug report. I.e.
aqua.yaml
---
registries:
- type: local
name: local
path: registry.yaml
packages:
#
btw aqua init
could also (optionally?) add the comment for the schema provided to LSP:
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json
📝 I thought maybe missing a newline at the end of file is related to this issue, so I removed it and tried again but I couldn't reproduce the issue.
btw
aqua init
could also (optionally?) add the comment for the schema provided to LSP:# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json
Could you open an issue for this? Now aqua doesn't support it.
I checked again because I saw about your try with
aqua init
and actually it is a comment at the end that I omitted from the bug report. I.e.aqua.yaml
--- registries: - type: local name: local path: registry.yaml packages: #
I see. I could reproduce the issue. Thank you. I could reproduce the issue without local registry.
$ cat aqua.yaml
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
# checksum:
# enabled: true
# require_checksum: true
# supported_envs:
# - all
registries:
- type: standard
ref: v4.239.1 # renovate: depName=aquaproj/aqua-registry
packages:
#
From the next time, could you use standard registry rather than local registry and github_content registry in the reproduction code if they are unnecessary to reproduce the issue? Then we can reproduce the issue easily.
I think it's difficult to solve the issue by aqua. This is an issue of goccy/go-yaml.
Regarding the schema comment, I opened #3202.
Regarding the panic I can reproduce it with local registries and multiple empty lines at the end of the file, e.g.:
---
registries:
- type: local
name: local
path: $HOME/.config/aqua/registry.yaml
packages:
# 3 empty lines below
Sure, I will use the standard registry next time as an example.
This is not blocking for me. Maybe the yaml library should solve this one and the other two issues.
Yeah, I reported an issue related to #584 #585 before, but it is stale.
I guess this is the cause.
aqua info
Overview
When running
aqua g -i
with an emptypackages
field, a panic occurs after a selection is done.How to reproduce
aqua.yaml
Executed command and output
Debug output
No response
Expected behaviour
I would expect the command to work normally, when the
packages
field is empty.Actual behaviour
A panic occurs.
Note
No response