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

Issue on Azure Pipelines: failed to initialize terrascan 1.7.0 #864

Closed
iquijas opened this issue Jun 14, 2021 · 3 comments
Closed

Issue on Azure Pipelines: failed to initialize terrascan 1.7.0 #864

iquijas opened this issue Jun 14, 2021 · 3 comments
Assignees

Comments

@iquijas
Copy link

iquijas commented Jun 14, 2021

  • terrascan version: 1.7.0
  • Operating System: Microsoft Hosted Agents for Azure Pipelines (Ubuntu 18.04 LTS)

### Description

As part of my pipeline definition, I install the latest terrascan version (1.7.0) in the agent and proceed to execute terrascan init & scan. Installation goes smoothly, but when terrascan init is executed the command crashes and the task is marked as error.

The only way I avoided this behavior is to install terrascan version 1.5.0 or earlier.

Thanks for your help/advice, Regards
Ignacio

### What I Did

In my pipeline I execute the following commands:

curl --location https://github.com/accurics/terrascan/releases/download/v1.7.0/terrascan_1.7.0_Linux_x86_64.tar.gz --output terrascan.tar.gz
tar -xf terrascan.tar.gz terrascan && rm terrascan.tar.gz
sudo install terrascan /usr/local/bin && rm terrascan
terrascan init -l debug

Terrascan init command fails, and the following error is generated:

2021-06-14T19:27:14.289Z debug cli/register.go:50 TERRASCAN_CONFIG:
2021-06-14T19:27:14.289Z debug config/config-reader.go:56 no config file specified
2021-06-14T19:27:14.289Z debug utils/policy.go:43 absolute rego_subdir path, /home/vsts/work/1/s/jumpbox/pkg/policies/opa/rego, does not fall under base repo path's /home/vsts/.terrascan directory structure
2021-06-14T19:27:14.289Z debug utils/policy.go:44 appending rego_subdir path: pkg/policies/opa/rego to the policy base path: /home/vsts/.terrascan. checking ...
2021-06-14T19:27:14.289Z debug config/global.go:118 global config loaded
2021-06-14T19:27:14.289Z debug initialize/run.go:39 initializing terrascan
2021-06-14T19:27:14.488Z debug initialize/run.go:68 downloading policies
2021-06-14T19:27:14.488Z debug initialize/run.go:70 base directory path : /home/vsts/.terrascan
2021-06-14T19:27:14.488Z debug initialize/run.go:71 policy directory path : /home/vsts/.terrascan/pkg/policies/opa/rego
2021-06-14T19:27:14.488Z debug initialize/run.go:72 policy repo url : https://github.com/accurics/terrascan.git
2021-06-14T19:27:14.488Z debug initialize/run.go:73 policy repo git branch : master
2021-06-14T19:27:14.488Z debug initialize/run.go:77 cloning terrascan repo at /home/vsts/.terrascan
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f37a3db1448]

runtime stack:
runtime.throw(0x2c37ad2, 0x2a)
/usr/lib/go-1.15/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
/usr/lib/go-1.15/src/runtime/signal_unix.go:726 +0x4ac

@kanchwala-yusuf
Copy link
Contributor

Hey @iquijas ,

Thanks for reporting this issue.

This issue looks similar to #835 .

One of our community members has also suggested a workaround for this:
#835 (comment)

Also, we are working on this and trying to figure out a solution for this problem.

@iquijas
Copy link
Author

iquijas commented Jun 29, 2021

Thank you @kanchwala-yusuf ! I will look into that workaround!

@kanchwala-yusuf
Copy link
Contributor

On digging a bit into this issue, it seems like an issue because of CGO. We have enabled CGO in terrascan due to a certain package dependency, have raised a #906 for fixing this issue.

@kanchwala-yusuf kanchwala-yusuf self-assigned this Jul 1, 2021
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

2 participants