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

Security error when building rock #22

Closed
gruyaume opened this issue Apr 16, 2024 · 1 comment
Closed

Security error when building rock #22

gruyaume opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gruyaume
Copy link
Collaborator

gruyaume commented Apr 16, 2024

Describe the bug

With the latest PR (#21), the rock does not build because of an issue unrelated to the PR change. There is logs below outlining the issue, it seems to stem from a security error when running go mod download all. The same error affects the following rocks:

  • SD-Core UDM
  • SD-Core SMF
  • SD-Core GNBSIM

To Reproduce

  1. Build the rock

Expected behavior

The rock builds

Logs

2024-04-15 12:26:06.685 plugin validation command: 'go version'
2024-04-15 12:26:06.735 executed go version with output go version go1.21.9 linux/amd64
2024-04-15 12:26:06.736 Executing PosixPath('/root/parts/amf/run/build.sh')
2024-04-15 12:26:06.738 :: + go mod download all
2024-04-15 12:26:08.183 :: verifying github.com/omec-project/[email protected]/go.mod: checksum mismatch
2024-04-15 12:26:08.184 ::   downloaded: h1:jDWasZ2XLFL2uSEWhgGlT/ELyrpwCJd/2kE/VEGG8Ew=
2024-04-15 12:26:08.184 ::   go.sum:     h1:oOkKRI2BIo8SHpCsEzNbo9qiowEtEy3q+wmO7TuDrx4=
2024-04-15 12:26:08.185 ::
2024-04-15 12:26:08.185 :: SECURITY ERROR
2024-04-15 12:26:08.186 :: This download does NOT match an earlier download recorded in go.sum.
2024-04-15 12:26:08.186 :: The bits may have been replaced on the origin server, or an attacker may
2024-04-15 12:26:08.186 :: have intercepted the download attempt.
2024-04-15 12:26:08.187 ::
2024-04-15 12:26:08.187 :: For more information, see 'go help module-auth'.
2024-04-15 12:26:08.188 Failed to run the build script for part 'amf'.
2024-04-15 12:26:08.192 Traceback (most recent call last):
2024-04-15 12:26:08.192   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 146, in _builtin_build
2024-04-15 12:26:08.192     _create_and_run_script(
2024-04-15 12:26:08.192   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 411, in _create_and_run_script
2024-04-15 12:26:08.192     subprocess.run(
2024-04-15 12:26:08.192   File "/snap/rockcraft/1670/usr/lib/python3.10/subprocess.py", line 526, in run
2024-04-15 12:26:08.192     raise CalledProcessError(retcode, process.args,
2024-04-15 12:26:08.192 subprocess.CalledProcessError: Command '[PosixPath('/root/parts/amf/run/build.sh')]' returned non-zero exit status 1.
2024-04-15 12:26:08.193 
2024-04-15 12:26:08.193 The above exception was the direct cause of the following exception:
2024-04-15 12:26:08.193 Traceback (most recent call last):
2024-04-15 12:26:08.193   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_application/services/lifecycle.py", line 196, in run
2024-04-15 12:26:08.193     aex.execute(action, stdout=stream, stderr=stream)
2024-04-15 12:26:08.193   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 318, in execute
2024-04-15 12:26:08.193     self._executor.execute(actions, stdout=stdout, stderr=stderr)
2024-04-15 12:26:08.194   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 137, in execute
2024-04-15 12:26:08.194     self._run_action(act, stdout=stdout, stderr=stderr)
2024-04-15 12:26:08.194   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 205, in _run_action
2024-04-15 12:26:08.194     handler.run_action(action, stdout=stdout, stderr=stderr)
2024-04-15 12:26:08.194   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 172, in run_action
2024-04-15 12:26:08.194     state = handler(step_info, stdout=stdout, stderr=stderr)
2024-04-15 12:26:08.194   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 309, in _run_build
2024-04-15 12:26:08.194     self._run_step(
2024-04-15 12:26:08.195   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line [493](https://github.com/canonical/sdcore-amf-rock/actions/runs/8688612794/job/23825832613?pr=21#step:3:495), in _run_step
2024-04-15 12:26:08.195     return step_handler.run_builtin()
2024-04-15 12:26:08.195   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 106, in run_builtin
2024-04-15 12:26:08.195     return handler()
2024-04-15 12:26:08.195   File "/snap/rockcraft/1670/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 155, in _builtin_build
2024-04-15 12:26:08.196     raise errors.PluginBuildError(part_name=self._part.name) from process_error
2024-04-15 12:26:08.196 craft_parts.errors.PluginBuildError: Failed to run the build script for part 'amf'.
@gatici
Copy link
Contributor

gatici commented Apr 25, 2024

The issue is fixed in all related rock repositories.

@gatici gatici closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants