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

Create Environment failing for serverless #2546

Closed
opauloh opened this issue Sep 20, 2024 · 0 comments · Fixed by #2547
Closed

Create Environment failing for serverless #2546

opauloh opened this issue Sep 20, 2024 · 0 comments · Fixed by #2547
Assignees
Labels
bug Something isn't working Team:Cloud Security Cloud Security team related

Comments

@opauloh
Copy link
Contributor

opauloh commented Sep 20, 2024

Describe the bug

As described in this slack thread @maxcold faced an issue when creating a serverless project with our GitHub action.

Screenshots

Image

Logs

Run ./install_agent_az_cli.sh
{
  "id": "/subscriptions/ef111ee2-6c89-4b09-92c6-5c2321f888df/resourceGroups/paulo-svl",
  "location": "eastus",
  "managedBy": null,
  "name": "paulo-svl",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}
ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/ef111ee2-6c89-4b09-92c6-5c2321f888df/resourceGroups/paulo-svl/providers/Microsoft.Resources/deployments/ARM-for-single-account","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/ef111ee2-6c89-4b09-92c6-5c2321f888df/resourceGroups/paulo-svl/providers/Microsoft.Resources/deployments/elastic-agent-deployment","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/subscriptions/ef111ee2-6c89-4b09-92c6-5c2321f888df/resourceGroups/paulo-svl/providers/Microsoft.Resources/deployments/elastic-agent-deployment","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/ef111ee2-6c89-4b09-92c6-5c2321f888df/resourceGroups/paulo-svl/providers/Microsoft.Compute/virtualMachines/cloudbeatVM/extensions/customScriptExtension","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"VMExtensionProvisioningError","message":"VM has reported a failure when processing extension 'customScriptExtension' (publisher 'Microsoft.Azure.Extensions' and type 'CustomScript'). Error message: 'Enable failed: failed to execute command: command terminated with exit status=2\n[stdout]\npasswd: password expiry information changed.\n\n[stderr]\n+ sudo passwd --delete cloudbeat\n+ usage='install-agent.sh <elastic agent version> <elastic artifact server> <fleet url> <enrollment token>'\n+ ElasticAgentVersion=8.15.0-SNAPSHOT\n+ ElasticArtifactServer=https://snapshots.elastic.co//downloads/beats/elastic-agent\n+ FleetUrl=https://a4ccf9b6d165400f8093fa102f8[77](https://github.com/elastic/cloudbeat/actions/runs/10957549040/job/30425918072#step:33:78)af0.fleet.us-east-1.aws.elastic.cloud:443\n+ EnrollmentToken=ZXB2Z0VKSUJRNXgzVXZNZmpNNW06LTNNdGJBZWtRX3lEeGprQzF2RjVzUQ==\n+ ElasticAgentArtifact=elastic-agent-8.15.0-SNAPSHOT-linux-x[86](https://github.com/elastic/cloudbeat/actions/runs/10957549040/job/30425918072#step:33:87)_64\n+ curl -L -O https://snapshots.elastic.co//downloads/beats/elastic-agent/elastic-agent-8.15.0-SNAPSHOT-linux-x86_64.tar.gz\n+ sudo systemctl disable --now ssh\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install disable ssh\n\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n+ tar xzf elastic-agent-8.15.0-SNAPSHOT-linux-x86_64.tar.gz\n\ngzip: stdin: unexpected end of file\ntar: Child returned status 1\ntar: Error is not recoverable: exiting now\n'. More information on troubleshooting is available at https://aka.ms/VMExtensionCSELinuxTroubleshoot. "}]}]}]}]}}

As discussed in this Slack thread, the cause of the issue is that serverless deployments use the CLOUDBEAT version instead of the values provided by the user as can seem here.

And now that we have larger release cycles, it happened that the previous version (i.e. 8.15.0) will no longer be available in the snapshtos.elastic.co for a large amount of time before we bump the version here (i.e 8.16.0).

In that case, I suggest we use the version inputted on the Create Environment parameter to download the agent's artifacts.

@opauloh opauloh added bug Something isn't working Team:Cloud Security Cloud Security team related labels Sep 20, 2024
@opauloh opauloh self-assigned this Oct 8, 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 Team:Cloud Security Cloud Security team related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant