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

Line overwrite causes corrupted error message #263

Closed
cmatsuoka opened this issue Jul 23, 2024 · 2 comments · Fixed by #270 · May be fixed by #265
Closed

Line overwrite causes corrupted error message #263

cmatsuoka opened this issue Jul 23, 2024 · 2 comments · Fixed by #270 · May be fixed by #265
Labels
Bug Something isn't working

Comments

@cmatsuoka
Copy link
Contributor

Bug Description

During a pack operation in brief mode, the following error message is seen:

craft-providers error: Failed to update apt cache.e from remote                                                                                                                       

The actual message from apt is craft-providers error: Failed to update apt cache., and e from remote is residue from a previous message.

To Reproduce

TBD

part yaml

No response

Relevant log output

craft-providers error: Failed to update apt cache.e from remote                                                                                                                       
* Command that failed: 'lxc --project snapcraft exec local:base-instance-snapcraft-buildd-base-v71--d799df4d4588b4abe861 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical apt-get update'
* Command exit code: 100
* Command output: b'Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease\nIgn:2 http://archive.ubuntu.com/ubuntu jammy InRelease\nIgn:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\nIgn:1 http://security.ubuntu.com/ubuntu jammy-security InRelease\nIgn:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\nIgn:1 http://security.ubuntu.com/ubuntu jammy-security InRelease\nIgn:2 http://archive.ubuntu.com/ubuntu jammy InRelease\nErr:1 http://security.ubuntu.com/ubuntu jammy-security InRelease\n  Connection failed [IP: 185.125.190.82 80]\nIgn:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\nIgn:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\nIgn:2 http://archive.ubuntu.com/ubuntu jammy InRelease\nIgn:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\nIgn:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\nErr:2 http://archive.ubuntu.com/ubuntu jammy InRelease\n  Connection failed [IP: 185.125.190.82 80]\nErr:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n  Connection failed [IP: 185.125.190.82 80]\nErr:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n  Connection failed [IP: 91.189.91.83 80]\nReading package lists...\n'
* Command standard error output: b'E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  Connection failed [IP: 185.125.190.82 80]\nE: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease  Connection failed [IP: 185.125.190.82 80]\nE: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease  Connection failed [IP: 91.189.91.83 80]\nE: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease  Connection failed [IP: 185.125.190.82 80]\nE: Some index files failed to download. They have been ignored, or old ones used instead.\n'
@cmatsuoka cmatsuoka added the Bug Something isn't working label Jul 23, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3144.

This message was autogenerated

@lengau
Copy link
Contributor

lengau commented Jul 24, 2024

I believe #210 fixes this.

tigarmo added a commit that referenced this issue Sep 5, 2024
The bug manifested in a situation like this:

- A long progress() message is printed, say "AAAAAAAA";
- An error is emitter, and the result of str(error) is a multi-line string
  where the first line is shorter than the previously-emitted progress()
  message. Example: "BBBB\nCCCC";
- The newline in the error message is not correctly handled by the printer,
  meaning that after "BBBB" is written to the terminal the remainder of the
  line is not cleared. So the end result looks like:
  > BBBBAAAA
  > CCCC

The "proper" fix for this would mean a big rework on the printer to properly
support multi-line messages; for now, fix only the error case by "manually"
splitting the error message and printing each line individually.

Fixes #263
@tigarmo tigarmo closed this as completed in 0ca6940 Sep 5, 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
Projects
None yet
2 participants