Skip to content

Add --share-log flag to upload install.log to paste.rs#4511

Open
Softer wants to merge 2 commits intoarchlinux:masterfrom
Softer:feat-share-log
Open

Add --share-log flag to upload install.log to paste.rs#4511
Softer wants to merge 2 commits intoarchlinux:masterfrom
Softer:feat-share-log

Conversation

@Softer
Copy link
Copy Markdown
Contributor

@Softer Softer commented May 1, 2026

Replaces the broken curl ... https://0x0.st hint with an integrated archinstall --share-log command that uploads /var/log/archinstall/install.log to paste.rs and prints a shareable URL. Also updates the same hint in the README, the bug report docs, and the GitHub bug issue template, so all four user-facing references now point to the working command.

Refs #4396 (0x0.st has disabled uploads). Supersedes #4507, which removes the hint without offering a replacement.

Why paste.rs

  • Text-oriented pastebin with extension-based syntax highlighting, so install.log renders as a readable page rather than a raw download
  • 10 MiB upload limit (well above realistic install.log sizes)
  • Curl-friendly, no account, no server-side state to maintain

The endpoint is referenced exactly once - a constant in archinstall/lib/share_log.py. If a self-hosted paste service is set up later, or 0x0.st returns, swapping it is a one-line change.

Behavior

$ archinstall --share-log
About to upload /var/log/archinstall/install.log (12345 bytes) to https://paste.rs 
The log may contain hostname, mirror URLs, package list and partition layout. The uploaded paste is public.
Continue? [y/N]: y 
https://paste.rs/abc.def 
  • All prompts, warnings and errors go to stderr
  • Only the final URL goes to stdout, so it can be piped (archinstall --share-log | xclip -sel clip)
  • The function exits early before _log_sys_info() and uses bare print() instead of info()/warn(), so the file uploaded matches the file on disk byte-for-byte (no "About to upload..." line gets injected into the log)
  • Explicit y/N confirmation; default is N
  • Privacy warning lists what the log can contain (hostname, mirror URLs, package list, partition layout)
  • File-not-found, empty file, file > 10 MiB, network failure and unexpected response are each handled with a clear message and non-zero exit

Test plan

  • archinstall --share-log on a live ISO - URL is printed and the paste matches install.log byte-for-byte
  • archinstall --share-log answering n - exits cleanly without uploading
  • archinstall --share-log with install.log missing - reports the error and exits non-zero
  • archinstall --share-log with no network - reports the error and exits non-zero
  • Trigger an install error and confirm the new hint is shown in the failure message

@Torxed
Copy link
Copy Markdown
Member

Torxed commented May 1, 2026

Just note that I started a conversation about an arch official channel for posting these logs. I created a ticket to track the progress on gitlab@archlinux #833

@Softer
Copy link
Copy Markdown
Contributor Author

Softer commented May 1, 2026

We can change --share-log behavior transparently for users any time we need without changing user's expectation. :)

Comment thread archinstall/lib/args.py
default=False,
help='Enabled verbose options',
)
parser.add_argument(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this sholdn't be an argument as an argument implies that you're running archinstall with that flag, but what you're doing here is running a command associated with archinstall. So it would make more sense to have it as

archinstall share-log

instead

@@ -0,0 +1,71 @@
import sys
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can move this into the output.py file as all log logic is consolidated there

f'Log file is too large to share: {size} bytes (limit: {_PASTE_MAX_SIZE} bytes). Trim it or upload manually.',
file=sys.stderr,
)
return 1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of returning we should truncate it from bottom up so we get the latest installation attempts. I don't envision many users running into this but it's better to get some logs than none at all

)

try:
answer = input('Continue? [y/N]: ').strip().lower()
Copy link
Copy Markdown
Collaborator

@svartkanin svartkanin May 3, 2026

Choose a reason for hiding this comment

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

We should be using the TUI here not the raw input stuff, have a look at the WifiHandler as that is also a standalone menu triggered from main.py

log_path = logger.path

if not log_path.exists():
print(f'Log file not found: {log_path}', file=sys.stderr)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use info instead as that will also appear in the logs and is testable (I promise one day we'll have tests)

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.

3 participants