Skip to content

Fixing the lexical error Hello-world test#2522

Merged
hash-d merged 1 commit into
skupperproject:2.2from
ramdrvcs:2.2
Jul 6, 2026
Merged

Fixing the lexical error Hello-world test#2522
hash-d merged 1 commit into
skupperproject:2.2from
ramdrvcs:2.2

Conversation

@ramdrvcs

@ramdrvcs ramdrvcs commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

it has been already pushed on the main branch
and the reference PR #2509

While I was running the E2E tests, I had the follwing error for hello-world module.

fatal: [west]: FAILED! => {"attempts": 30, "changed": true, "msg": "Task failed: Action failed: Unknown error.", "rc": 1, "return_code": 1, 
"stderr": "cannot parse the data: `lexical error: invalid character inside string.\n
{\"user\":{\"uid\":0,\"gid\":0,\"addi\n                     (right here) ------^\n`\n",
"stderr_lines": ["cannot parse the data: `lexical error: invalid character inside string.", " 
{\"user\":{\"uid\":0,\"gid\":0,\"addi", "                     (right here) ------^", "`"], 
"stdout": "", "stdout_lines": []}

Description

Fixes a critical runtime failure in the run_curl role where the task fails with an Unknown error (lexical error: invalid character inside string).

The failure occurs because ansible task definition contain end of line character in sh location. As of now it has been noticed in s390x.

Changes

Key Changes

  • Single Network Call (curl -s -w "\n%{http_code}" "{{ run_curl_address }}"): Reduces traffic by making exactly one request to the backend. The API response text is captured alongside the 3-digit HTTP status code, which is appended to a brand-new line at the very bottom.
  • Local Code Extraction (tail -n 1): Pipes the combined response string and isolates only the final line to extract the HTTP status code.
  • Local Body Preservation (sed "$ d"): Trims the appended status code line from the stream, safely preserving the original API message body (including any native trailing text or newlines).
  • Defensive String Evaluation ([ "$code" = "200" ]): Switches the conditional check to a robust string comparison. This protects the shell executor from crashing if network drops cause the status code to return empty.
  • Clean YAML Syntax: Formatted using the folded block scalar (>) to preserve intended script indentation and readability without breaking the Kubernetes command processor array.

Testing Triaged

  • Verified that payloads containing nested JSON quotes no longer trigger a lexical error.
  • Confirmed that the loop correctly runs exactly one HTTP request per retry iteration.
  • Confirmed the task successfully completed.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24e711ac-32dd-4101-bd0b-909cc29d3063

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hash-d hash-d self-requested a review July 6, 2026 18:06

@hash-d hash-d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@hash-d hash-d merged commit 72cd15a into skupperproject:2.2 Jul 6, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants