apiVersion: jenkins.io/v1 kind: PipelineActivity metadata: annotations: lighthouse.jenkins-x.io/cloneURI: https://github.com/greencapitaltrade/flash.git lighthouse.jenkins-x.io/job: release pipeline.jenkins-x.io/traceID: 71aa899fb7c6fced25d8b822b3f8023d creationTimestamp: "2026-07-04T11:01:11Z" generation: 8 labels: branch: main build: "112" context: release created-by-lighthouse: "true" event-GUID: a8b5b418-7797-11f1-876a-de4240e41ebb lighthouse.jenkins-x.io/baseSHA: 857cab069e7a529955b8261d00b67145499dffc2 lighthouse.jenkins-x.io/branch: main lighthouse.jenkins-x.io/buildNum: "1783162871687" lighthouse.jenkins-x.io/context: release lighthouse.jenkins-x.io/id: ncapitaltrade-flash-main-release-69gr4 lighthouse.jenkins-x.io/job: release lighthouse.jenkins-x.io/lastCommitSHA: 857cab069e7a529955b8261d00b67145499dffc2 lighthouse.jenkins-x.io/refs.org: greencapitaltrade lighthouse.jenkins-x.io/refs.repo: flash lighthouse.jenkins-x.io/type: postsubmit owner: greencapitaltrade podName: ncapitaltrade-flash-main-release-p9x5j-from-build-pack-pod provider: github repository: flash tekton.dev/pipeline: ncapitaltrade-flash-main-release managedFields: - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:branch: {} f:context: {} f:owner: {} f:provider: {} f:repository: {} f:spec: f:lastCommitMessage: {} f:lastCommitSHA: {} f:releaseNotesURL: {} f:version: {} manager: jx-changelog-0.10.22 operation: Update time: "2026-07-04T11:08:23Z" - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:lighthouse.jenkins-x.io/cloneURI: {} f:lighthouse.jenkins-x.io/job: {} f:pipeline.jenkins-x.io/traceID: {} f:labels: .: {} f:build: {} f:created-by-lighthouse: {} f:event-GUID: {} f:lighthouse.jenkins-x.io/baseSHA: {} f:lighthouse.jenkins-x.io/branch: {} f:lighthouse.jenkins-x.io/buildNum: {} f:lighthouse.jenkins-x.io/context: {} f:lighthouse.jenkins-x.io/id: {} f:lighthouse.jenkins-x.io/job: {} f:lighthouse.jenkins-x.io/lastCommitSHA: {} f:lighthouse.jenkins-x.io/refs.org: {} f:lighthouse.jenkins-x.io/refs.repo: {} f:lighthouse.jenkins-x.io/type: {} f:podName: {} f:tekton.dev/pipeline: {} f:spec: .: {} f:baseSHA: {} f:batchPipelineActivity: {} f:build: {} f:buildLogsUrl: {} f:completedTimestamp: {} f:context: {} f:gitBranch: {} f:gitOwner: {} f:gitRepository: {} f:gitUrl: {} f:message: {} f:pipeline: {} f:startedTimestamp: {} f:status: {} f:steps: {} manager: jx-build-controller operation: Update time: "2026-07-04T11:09:20Z" name: greencapitaltrade-flash-main-112 namespace: jx resourceVersion: "160306088" uid: c0896c82-75a8-4d0d-83bf-a69af25aae01 spec: baseSHA: 857cab069e7a529955b8261d00b67145499dffc2 batchPipelineActivity: {} build: "112" buildLogsUrl: s3://logs-gct-prod-20260425045301534100000007/jenkins-x/logs/greencapitaltrade/flash/main/112.log completedTimestamp: "2026-07-04T11:09:09Z" context: release gitBranch: main gitOwner: greencapitaltrade gitRepository: flash gitUrl: https://github.com/greencapitaltrade/flash.git lastCommitMessage: | fix(flash): stop Next clobbering the /ws WebSocket upgrade (live-tick flap) Every WS connection died with 1006 ~4ms after a successful 101 handshake, so no live telemetry ever reached the map. Root cause: Next.js's custom-server integration lazily attaches its OWN 'upgrade' listener on the first HTTP request (setupWebSocketHandler in next/dist/server/next.js). That listener runs resolveRoutes({isUpgradeReq}) and calls socket.end() for any upgrade whose path matches a Next output — and flash's middleware matches /ws. With `new WebSocketServer({ server, path: '/ws' })`, BOTH the ws listener and Next's listener fire on the same upgrade: ws completes the 101, then Next ends the socket. It looked port-8080-specific only because the k8s readiness probe on `/` is what triggered Next's attach in prod (a fresh process with no prior HTTP request kept WS alive). Fix: drive the upgrade event ourselves. - `new WebSocketServer({ noServer: true })` - set `app.didWebSocketSetup = true` so Next does not attach its duplicate listener - single `server.on('upgrade')` router: `/ws` -> our WS server; everything else -> `app.getUpgradeHandler()` so Next's HMR / Fast Refresh upgrade still works. Verified against the real flash next build in-pod: /ws now survives before AND after HTTP requests (previously died after the first HTTP request), and non-/ws upgrades are delegated to Next. Also removes the temporary [ws-dbg] diagnostics. lastCommitSHA: 01ba6714a12689542e8e1c170bcfaa3aba99412b message: 'Tasks Completed: 1 (Failed: 1, Cancelled 0), Skipped: 0' pipeline: greencapitaltrade/flash/main releaseNotesURL: https://github.com/greencapitaltrade/flash/releases/tag/v0.13.7 startedTimestamp: "2026-07-04T11:01:11Z" status: Failed steps: - kind: Stage stage: completedTimestamp: "2026-07-04T11:09:09Z" name: from build pack startedTimestamp: "2026-07-04T11:01:17Z" status: Failed steps: - completedTimestamp: "2026-07-04T11:01:25Z" name: Git Clone startedTimestamp: "2026-07-04T11:01:17Z" status: Succeeded - completedTimestamp: "2026-07-04T11:01:27Z" name: Next Version startedTimestamp: "2026-07-04T11:01:25Z" status: Succeeded - completedTimestamp: "2026-07-04T11:01:31Z" name: Jx Variables startedTimestamp: "2026-07-04T11:01:27Z" status: Succeeded - completedTimestamp: "2026-07-04T11:04:32Z" name: Build Yarn Install startedTimestamp: "2026-07-04T11:01:31Z" status: Succeeded - completedTimestamp: "2026-07-04T11:05:24Z" name: Next Build startedTimestamp: "2026-07-04T11:04:33Z" status: Succeeded - completedTimestamp: "2026-07-04T11:05:27Z" name: Check Registry startedTimestamp: "2026-07-04T11:05:24Z" status: Succeeded - completedTimestamp: "2026-07-04T11:08:12Z" name: Build Container Build startedTimestamp: "2026-07-04T11:05:27Z" status: Succeeded - completedTimestamp: "2026-07-04T11:08:23Z" name: Promote Changelog startedTimestamp: "2026-07-04T11:08:12Z" status: Succeeded - completedTimestamp: "2026-07-04T11:08:26Z" name: Promote Helm Release startedTimestamp: "2026-07-04T11:08:23Z" status: Succeeded - completedTimestamp: "2026-07-04T11:09:04Z" name: Promote Jx Promote startedTimestamp: "2026-07-04T11:08:27Z" status: Succeeded - completedTimestamp: "2026-07-04T11:09:09Z" name: Publish Org Kb startedTimestamp: "2026-07-04T11:09:05Z" status: Failed - kind: Promote promote: environment: staging pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4624 startedTimestamp: "2026-07-04T11:08:47Z" status: Succeeded startedTimestamp: "2026-07-04T11:08:47Z" status: Succeeded - kind: Promote promote: environment: production pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4625 startedTimestamp: "2026-07-04T11:09:01Z" status: Succeeded startedTimestamp: "2026-07-04T11:09:01Z" status: Succeeded version: 0.13.7 status: {}