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

[BUG] ANSI control characters in digital twin execution logs #971

Open
prasadtalasila opened this issue Oct 12, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@prasadtalasila
Copy link
Contributor

Describe the bug

The Digital Twins Preview page has Log button to show execution logs of a digital twin. This log has ANSI control characters that need be removed. A sample log is here.

create_mass-spring-damper

�[0KRunning with gitlab-runner 17.3.1 (66269445)�[0;m
�[0K  on dtaas _ovdZwuzX, system ID: s_0a5b507aa2c7�[0;m
section_start:1728713779:prepare_executor
�[0K�[0K�[36;1mPreparing the "docker" executor�[0;m�[0;m
�[0KUsing Docker executor with image ubuntu:20.04 ...�[0;m
�[0KPulling docker image ubuntu:20.04 ...�[0;m
�[0KUsing docker image sha256:9522b5ff29b80fb026c27040cc14b743d714a57f3ca4cff1c76c9e59ca244163 for ubuntu:20.04 with digest ubuntu@sha256:6d8d9799fe6ab3221965efac00b4c34a2bcc102c086a58dff9e19a08b913c7ef ...�[0;m
section_end:1728713782:prepare_executor
�[0Ksection_start:1728713782:prepare_script
�[0K�[0K�[36;1mPreparing environment�[0;m�[0;m
Running on runner-ovdzwuzx-project-8-concurrent-0 via dtaas...
section_end:1728713782:prepare_script

To Reproduce

Steps to reproduce the behavior:

  1. Make sure that a valid gitlab repository exists. For example, if your username is "freya", then a gitlab project must be avalable at REACT_APP_AUTH_AUTHORITY/dtaas/freya
  2. Make sure that a live Gitlab runner is available for this gitlab project.
  3. Log into the react website and go to Digital Twins Preview Page
  4. Click on start button of any digital twin and wait for it to complete the execution
  5. See the logs by clicking on log button

Expected behavior

The ANSI control characters should be removed from the logs and a sample log could be

create_mass-spring-damper

Running with gitlab-runner 17.3.1 (66269445)
  on dtaas _ovdZwuzX, system ID: s_0a5b507aa2c7

prepare_executor
Preparing the "docker" executor
Using Docker executor with image ubuntu:20.04 ...
Pulling docker image ubuntu:20.04 ...
Using docker image sha256:9522b5ff29b80fb026c27040cc14b743d714a57f3ca4cff1c76c9e59ca244163 for ubuntu:20.04 with digest ubuntu@sha256:6d8d9799fe6ab3221965efac00b4c34a2bcc102c086a58dff9e19a08b913c7ef ...�[0;m
section_end:1728713782:prepare_executor
section_start:1728713782:prepare_script
Preparing environment
Running on runner-ovdzwuzx-project-8-concurrent-0 via dtaas...
section_end:1728713782:prepare_script

Application Environment

The behavior can be seen on all OS, all browsers and code on caa92c2 commit

Additional context

strip-ansi npm library solves the problem but it throws up a Jest SyntaxError. Please see issue #902

@prasadtalasila prasadtalasila added the bug Something isn't working label Oct 12, 2024
@prasadtalasila prasadtalasila added this to the Release v0.7.0 milestone Oct 12, 2024
@prasadtalasila
Copy link
Contributor Author

This problem gets solved using strip-ansi but tests fail if this package is used. Please see issue #902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

1 participant