Skip to content

Remove input private key from config shared with shipper#2096

Closed
faec wants to merge 3 commits intoelastic:mainfrom
faec:remove-pk
Closed

Remove input private key from config shared with shipper#2096
faec wants to merge 3 commits intoelastic:mainfrom
faec:remove-pk

Conversation

@faec
Copy link
Copy Markdown
Contributor

@faec faec commented Jan 13, 2023

What does this PR do?

The shipper is currently given all key data from the input units, including the private key, but only the input unit itself should have the private key.

@faec faec added the bug Something isn't working label Jan 13, 2023
@faec faec requested a review from blakerouse January 13, 2023 18:49
@faec faec requested a review from a team as a code owner January 13, 2023 18:49
@faec faec self-assigned this Jan 13, 2023
@faec faec requested review from michalpristas and removed request for a team January 13, 2023 18:49
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jan 13, 2023

This pull request does not have a backport label. Could you fix it @faec? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 13, 2023

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-05-15T12:07:07.213+0000

  • Duration: 16 min 0 sec

Test stats 🧪

Test Results
Failed 4
Passed 5587
Skipped 19
Total 5610

Test errors 4

Expand to view the tests failures

Test / Matrix - PLATFORM = 'ubuntu-22 && immutable' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestManager_FakeShipper
        manager_test.go:2543: component state changed: {State:STARTING Message:Starting: spawned pid '40896' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '40896' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '40896' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0003283f0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003282d0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2479: shipper state changed: {State:STARTING Message:Starting: spawned pid '40904' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '40904' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '40904' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000328240 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003285a0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '40896' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '40896' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '40896' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0003283f0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003282d0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"time":"2023-05-15T12:15:54Z","message":"unit change received","level":"info","state":"STARTING","expectedState":"HEALTHY","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:15:54Z","message":"registering set_state action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:15:54Z","message":"registering send_event action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:15:54Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"time":"2023-05-15T12:15:54Z","message":"registering retrieve_features action for unit","level":"trace","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"HEALTHY","message":"updating unit state","time":"2023-05-15T12:15:54Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","kill_on_interval":false,"time":"2023-05-15T12:15:54Z","message":"kill_on_interval config set value","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","time":"2023-05-15T12:15:54Z","message":"stopping interval killer","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","state":"STARTING","expectedState":"HEALTHY","time":"2023-05-15T12:15:54Z","message":"unit change received","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:15:54Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"restarting shipper output","time":"2023-05-15T12:15:54Z","level":"debug","state":"CONFIGURING","ecs.version":"1.6.0"}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '40896' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0003283f0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003282d0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '40896' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:CONFIGURING Message:Configuring Payload:map[] unitState:1 unitMessage:Configuring unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0003283f0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003282d0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"time":"2023-05-15T12:15:54Z","level":"debug","state":"HEALTHY","message":"connected to output","ecs.version":"1.6.0"}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '40896' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:GRPC fake event pipe connected "unix:///tmp/at-838592655/tmp/elastic-agent-fake-shipper-default-pipe.sock" Payload:map[] unitState:2 unitMessage:GRPC fake event pipe connected "unix:///tmp/at-838592655/tmp/elastic-agent-fake-shipper-default-pipe.sock" unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0003283f0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003282d0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '40904' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '40904' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '40904' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000328240 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003285a0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"info","server":"unix:///tmp/at-838592655/tmp/elastic-agent-fake-shipper-default-pipe.sock","time":"2023-05-15T12:15:54Z","message":"starting GRPC fake shipper server","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"trace","time":"2023-05-15T12:15:54Z","message":"registering record event action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"trace","time":"2023-05-15T12:15:54Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"message":"updating unit state","time":"2023-05-15T12:15:54Z","level":"debug","state":"HEALTHY","ecs.version":"1.6.0"}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '40904' Units:map[{UnitType:input UnitID:fake-default}:{State:FAILED Message:Error: ssl configuration missing Payload:map[] unitState:4 unitMessage:Error: ssl configuration missing unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:Healthy Payload:map[] unitState:2 unitMessage:Healthy unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000328240 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003285a0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2605: 
            	Error Trace:	/var/lib/jenkins/workspace/_agent_elastic-agent-mbp_PR-2096/src/github.com/elastic/elastic-agent/pkg/component/runtime/manager_test.go:2605
            	Error:      	Received unexpected error:
            	            	unit failed: Error: ssl configuration missing
            	Test:       	TestManager_FakeShipper
    --- FAIL: TestManager_FakeShipper (2.06s)
     
    

Test / Matrix - PLATFORM = 'aws && aarch64 && gobld/diskSizeGb:200' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestManager_FakeShipper
        manager_test.go:2543: component state changed: {State:STARTING Message:Starting: spawned pid '22187' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '22187' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '22187' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0x40005f02d0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039ccf0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2479: shipper state changed: {State:STARTING Message:Starting: spawned pid '22198' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '22198' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '22198' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039c900 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x4000196bd0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '22187' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '22187' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '22187' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0x40005f02d0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039ccf0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"unit change received","level":"info","state":"STARTING","expectedState":"HEALTHY","time":"2023-05-15T12:19:24Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:19:24Z","message":"registering set_state action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"registering send_event action for unit","level":"trace","time":"2023-05-15T12:19:24Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:19:24Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:19:24Z","message":"registering retrieve_features action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"HEALTHY","message":"updating unit state","time":"2023-05-15T12:19:24Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"time":"2023-05-15T12:19:24Z","message":"kill_on_interval config set value","level":"trace","kill_on_interval":false,"ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","time":"2023-05-15T12:19:24Z","message":"stopping interval killer","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"unit change received","level":"info","state":"STARTING","expectedState":"HEALTHY","time":"2023-05-15T12:19:24Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:19:24Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"state":"CONFIGURING","message":"restarting shipper output","time":"2023-05-15T12:19:24Z","level":"debug","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"HEALTHY","message":"connected to output","time":"2023-05-15T12:19:24Z","ecs.version":"1.6.0"}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '22187' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:CONFIGURING Message:Configuring Payload:map[] unitState:1 unitMessage:Configuring unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0x40005f02d0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039ccf0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '22187' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:GRPC fake event pipe connected "unix:///tmp/at-3212604774/tmp/elastic-agent-fake-shipper-default-pipe.sock" Payload:map[] unitState:2 unitMessage:GRPC fake event pipe connected "unix:///tmp/at-3212604774/tmp/elastic-agent-fake-shipper-default-pipe.sock" unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0x40005f02d0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039ccf0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '22198' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '22198' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '22198' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039c900 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x4000196bd0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"time":"2023-05-15T12:19:24Z","message":"starting GRPC fake shipper server","level":"info","server":"unix:///tmp/at-3212604774/tmp/elastic-agent-fake-shipper-default-pipe.sock","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"trace","time":"2023-05-15T12:19:24Z","message":"registering record event action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"time":"2023-05-15T12:19:24Z","message":"registering kill action for unit","level":"trace","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"message":"updating unit state","time":"2023-05-15T12:19:24Z","level":"debug","state":"HEALTHY","ecs.version":"1.6.0"}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '22198' Units:map[{UnitType:input UnitID:fake-default}:{State:FAILED Message:Error: ssl configuration missing Payload:map[] unitState:4 unitMessage:Error: ssl configuration missing unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:Healthy Payload:map[] unitState:2 unitMessage:Healthy unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x400039c900 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0x4000196bd0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2605: 
            	Error Trace:	/var/lib/jenkins/workspace/_agent_elastic-agent-mbp_PR-2096/src/github.com/elastic/elastic-agent/pkg/component/runtime/manager_test.go:2605
            	Error:      	Received unexpected error:
            	            	unit failed: Error: ssl configuration missing
            	Test:       	TestManager_FakeShipper
    --- FAIL: TestManager_FakeShipper (3.82s)
     
    

Test / Matrix - PLATFORM = 'windows-2022 && windows-immutable' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestManager_FakeShipper
        manager_test.go:2543: component state changed: {State:STARTING Message:Starting: spawned pid '896' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '896' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '896' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc000306900 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000306240 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2479: shipper state changed: {State:STARTING Message:Starting: spawned pid '2728' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '2728' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '2728' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003061b0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000306ab0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '896' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '896' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '896' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc000306900 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000306240 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '896' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:GRPC fake event pipe connected "\\\\.\\pipe\\elastic-agent-d0136f3ddfc505b78cef7fe30fb00dd8a9e019b34aefe0692b02191bcb6b106c-fake-shipper-default-pipe" Payload:map[] unitState:2 unitMessage:GRPC fake event pipe connected "\\\\.\\pipe\\elastic-agent-d0136f3ddfc505b78cef7fe30fb00dd8a9e019b34aefe0692b02191bcb6b106c-fake-shipper-default-pipe" unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc000306900 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000306240 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","state":"STARTING","expectedState":"HEALTHY","time":"2023-05-15T12:21:25Z","message":"unit change received","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:21:25Z","message":"registering set_state action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:21:25Z","message":"registering send_event action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:21:25Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:21:25Z","message":"registering retrieve_features action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"updating unit state","time":"2023-05-15T12:21:25Z","level":"debug","state":"HEALTHY","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","kill_on_interval":false,"time":"2023-05-15T12:21:25Z","message":"kill_on_interval config set value","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","time":"2023-05-15T12:21:25Z","message":"stopping interval killer","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","state":"STARTING","expectedState":"HEALTHY","time":"2023-05-15T12:21:25Z","message":"unit change received","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:21:25Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"CONFIGURING","message":"restarting shipper output","time":"2023-05-15T12:21:25Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"HEALTHY","message":"connected to output","time":"2023-05-15T12:21:25Z","ecs.version":"1.6.0"}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '2728' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '2728' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '2728' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003061b0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000306ab0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"info","server":"\\\\.\\pipe\\elastic-agent-d0136f3ddfc505b78cef7fe30fb00dd8a9e019b34aefe0692b02191bcb6b106c-fake-shipper-default-pipe","time":"2023-05-15T12:21:26Z","message":"starting GRPC fake shipper server","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"message":"registering record event action for unit","level":"trace","time":"2023-05-15T12:21:26Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"trace","time":"2023-05-15T12:21:26Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"level":"debug","state":"HEALTHY","message":"updating unit state","time":"2023-05-15T12:21:26Z","ecs.version":"1.6.0"}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '2728' Units:map[{UnitType:input UnitID:fake-default}:{State:FAILED Message:Error: ssl configuration missing Payload:map[] unitState:4 unitMessage:Error: ssl configuration missing unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:Healthy Payload:map[] unitState:2 unitMessage:Healthy unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0003061b0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc000306ab0 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2605: 
            	Error Trace:	C:/Users/jenkins/workspace/_agent_elastic-agent-mbp_PR-2096/src/github.com/elastic/elastic-agent/pkg/component/runtime/manager_test.go:2605
            	Error:      	Received unexpected error:
            	            	unit failed: Error: ssl configuration missing
            	Test:       	TestManager_FakeShipper
    --- FAIL: TestManager_FakeShipper (3.59s)
     
    

Test / Matrix - PLATFORM = 'windows-2016 && windows-immutable' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestManager_FakeShipper
        manager_test.go:2543: component state changed: {State:STARTING Message:Starting: spawned pid '2536' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '2536' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '2536' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0004ec1b0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec090 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2479: shipper state changed: {State:STARTING Message:Starting: spawned pid '92' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '92' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '92' Payload:map[] unitState:0 unitMessage:Starting unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name: Version: Meta:map[]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec000 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec360 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '2536' Units:map[{UnitType:input UnitID:fake-input}:{State:STARTING Message:Starting: spawned pid '2536' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '2536' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0004ec1b0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec090 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","state":"STARTING","expectedState":"HEALTHY","time":"2023-05-15T12:22:45Z","message":"unit change received","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:22:45Z","message":"registering set_state action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:22:45Z","message":"registering send_event action for unit","ecs.version":"1.6.0"}
        manager_test.go:2543: component state changed: {State:HEALTHY Message:Healthy: communicating with pid '2536' Units:map[{UnitType:input UnitID:fake-input}:{State:HEALTHY Message:Fake Healthy Payload:map[] unitState:2 unitMessage:Fake Healthy unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:GRPC fake event pipe connected "\\\\.\\pipe\\elastic-agent-a076fa767b50f02ce4153a8656272a068e644179825b4647e216ad05d6cbb121-fake-shipper-default-pipe" Payload:map[] unitState:2 unitMessage:GRPC fake event pipe connected "\\\\.\\pipe\\elastic-agent-a076fa767b50f02ce4153a8656272a068e644179825b4647e216ad05d6cbb121-fake-shipper-default-pipe" unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake Version:1.0 Meta:map[input:fake]} expectedUnits:map[{UnitType:0 UnitID:fake-input}:{state:2 configStateIdx:1 config:0xc0004ec1b0 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec090 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:22:45Z","message":"registering kill action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"trace","time":"2023-05-15T12:22:45Z","message":"registering retrieve_features action for unit","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"HEALTHY","message":"updating unit state","time":"2023-05-15T12:22:45Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"kill_on_interval config set value","level":"trace","kill_on_interval":false,"time":"2023-05-15T12:22:45Z","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"info","time":"2023-05-15T12:22:45Z","message":"stopping interval killer","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"time":"2023-05-15T12:22:45Z","message":"unit change received","level":"info","state":"STARTING","expectedState":"HEALTHY","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"time":"2023-05-15T12:22:45Z","message":"registering kill action for unit","level":"trace","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"message":"restarting shipper output","time":"2023-05-15T12:22:45Z","level":"debug","state":"CONFIGURING","ecs.version":"1.6.0"}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-default","type":"fake"},"log":{"source":"fake-default"},"level":"debug","state":"HEALTHY","message":"connected to output","time":"2023-05-15T12:22:45Z","ecs.version":"1.6.0"}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '92' Units:map[{UnitType:input UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '92' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>} {UnitType:output UnitID:fake-default}:{State:STARTING Message:Starting: spawned pid '92' Payload:map[] unitState:0 unitMessage: unitPayload:map[] configStateIdx:0 err:<nil>}] Features:<nil> FeaturesIdx:0 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec000 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec360 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
    {"log.level":"info","@timestamp":"0000-01-01T00:00:00.000Z","message":"","component":{"binary":"","dataset":"elastic_agent.","id":"fake-shipper-default","type":"fake-shipper"},"log":{"source":"fake-shipper-default"},"server":"\\\\.\\pipe\\elastic-agent-a076fa767b50f02ce4153a8656272a068e644179825b4647e216ad05d6cbb121-fake-shipper-default-pipe","time":"2023-05-15T12:22:45Z","message":"starting GRPC fake shipper server","level":"info","ecs.version":"1.6.0"}
        manager_test.go:2479: shipper state changed: {State:HEALTHY Message:Healthy: communicating with pid '92' Units:map[{UnitType:input UnitID:fake-default}:{State:FAILED Message:Error: ssl configuration missing Payload:map[] unitState:4 unitMessage:Error: ssl configuration missing unitPayload:map[] configStateIdx:1 err:<nil>} {UnitType:output UnitID:fake-default}:{State:HEALTHY Message:Healthy Payload:map[] unitState:2 unitMessage:Healthy unitPayload:map[] configStateIdx:1 err:<nil>}] Features:<nil> FeaturesIdx:1 VersionInfo:{Name:fake-shipper Version:1.0 Meta:map[shipper:fake-shipper]} expectedUnits:map[{UnitType:0 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec000 err:<nil> logLevel:4} {UnitType:1 UnitID:fake-default}:{state:2 configStateIdx:1 config:0xc0004ec360 err:<nil> logLevel:4}] expectedFeatures:<nil> expectedFeaturesIdx:1}
        manager_test.go:2605: 
            	Error Trace:	C:/Users/jenkins/workspace/_agent_elastic-agent-mbp_PR-2096/src/github.com/elastic/elastic-agent/pkg/component/runtime/manager_test.go:2605
            	Error:      	Received unexpected error:
            	            	unit failed: Error: ssl configuration missing
            	Test:       	TestManager_FakeShipper
    --- FAIL: TestManager_FakeShipper (4.36s)
     
    

Steps errors 8

Expand to view the steps failures

Go unitTest
  • Took 2 min 56 sec . View more details here
  • Description: mage unitTest
Publish Cobertura Coverage Report
  • Took 0 min 2 sec . View more details here
  • Description: [2023-05-15T12:16:01.746Z] [Cobertura] Publishing Cobertura coverage report... [2023-05-15T12:16:01
Go unitTest
  • Took 2 min 2 sec . View more details here
  • Description: mage unitTest
Checks if running on a Unix-like node
  • Took 0 min 0 sec . View more details here
  • Description: script returned exit code 1
Go unitTest
  • Took 3 min 56 sec . View more details here
  • Description: mage unitTest
Checks if running on a Unix-like node
  • Took 0 min 0 sec . View more details here
  • Description: script returned exit code 1
Go unitTest
  • Took 3 min 5 sec . View more details here
  • Description: mage unitTest
Checks if running on a Unix-like node
  • Took 0 min 0 sec . View more details here
  • Description: script returned exit code 1

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 4

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Test / Matrix - PLATFORM = 'ubuntu-22 && immutable' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
  • Name: Test / Matrix - PLATFORM = 'aws && aarch64 && gobld/diskSizeGb:200' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
  • Name: Test / Matrix - PLATFORM = 'windows-2022 && windows-immutable' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime
  • Name: Test / Matrix - PLATFORM = 'windows-2016 && windows-immutable' / Test / TestManager_FakeShipper – github.com/elastic/elastic-agent/pkg/component/runtime

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

blakerouse
blakerouse previously approved these changes Jan 13, 2023
Copy link
Copy Markdown
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with this change. Possible this broke the fake shipper tests.

@faec faec added the Team:Elastic-Agent Label for the Agent team label Jan 13, 2023
@faec
Copy link
Copy Markdown
Contributor Author

faec commented Jan 13, 2023

@blakerouse Could you take a closer look? The fix for the current error isn't obvious to me, and seems like a bug in the configuration testing:

The error arises in newFakeShipperInput which as far as I can tell is only called on input units (in newRunningUnit the check is unit.Type() == client.UnitTypeInput). But at that point in the code, there should be a private key. This makes me wonder if the test data given to Manager.connectShippers (where the logical change was just made) has a non-nil ShipperSpec for its fake input units, in which case it isn't testing the behavior on a valid input configuration.

But that's where I lose the thread, because the initialization for fake units seems considerably different than for real ones and I'm not sure where it's diverging. Simply removing the srvCfg.TLS.Key == "" check from newFakeShipperInput would resolve the immediate error, but in that case it would just be silently testing the wrong code paths.

@michalpristas
Copy link
Copy Markdown
Contributor

/package

@michalpristas
Copy link
Copy Markdown
Contributor

michalpristas commented May 15, 2023

i think i remember something like this with ast maps, it was something with references, that object where key map got injected got niled when it exited a block if i recall correctly

@pierrehilbert
Copy link
Copy Markdown
Contributor

@faec do we still need this one with the new shipper plan?

@pierrehilbert
Copy link
Copy Markdown
Contributor

Closing this one for now as we will need to rewrite things following the new Shipper plan.

@faec faec deleted the remove-pk branch June 6, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip bug Something isn't working Team:Elastic-Agent Label for the Agent team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants