#10371

`jj resolve` errors with "Failed to decode UTF-8 text for item conflicting hunk (this should not happen)" on a binary file

Openxobsopened 18d ago

Description

I was working on a repository and somehow it got conflicted. I tried to resolve it with jj resolve and it errored.

Steps to Reproduce the Problem

  1. Unclear how to get the repository into this state
  2. Run jj resolve

Expected Behavior

It should resolve

Actual Behavior

$ jj resolve
Hint: Using default editor ':builtin'; run `jj config set --user ui.merge-editor :builtin` to disable this message.
Error: Failed to resolve conflicts
Caused by:
1: Failed to decode UTF-8 text for item conflicting hunk (this should not happen)
2: invalid utf-8 sequence of 1 bytes from index 3131

$

Specifications

  • Platform: mac
  • Version: jj 0.46.0

Activity

4
xobs18d ago

I don't think the logs are very interesting, but here you go anyway:

$ jj log -T builtin_log_redacted
×  vmqyrzvs user-366a 2026-10-12 13:08:47 ff3ee549 (conflict)
│  (redacted)
@  ytpyoyqn user-366a 2026-10-12 13:08:47 acc5e7b2 (conflict)
│  (redacted)
○  kmmuxzpy user-366a 2026-10-12 13:08:47 27eb0b18
│  (redacted)
○  twpwwrys user-da00 2026-10-12 12:52:02 bookmark-a7ad 14ae71f6
│  (redacted)
◆  rvtnlsvy user-fdf7 2021-01-25 03:03:29 bookmark-4cba* bookmark-4cba@remote-86e9 73915cb7
│  (redacted)
~

$ jj op log -T builtin_op_log_redacted
@  8580e99cafd2 user-d8bf workspace-ab88@ 6 minutes ago, lasted 13 milliseconds
│  edit commit acc5e7b238227349611e201d59efbd4989452d75
│  (redacted)
○  fdc52ae590c0 user-d8bf workspace-ab88@ 6 minutes ago, lasted 31 milliseconds
│  snapshot working copy
│  (redacted)
○  792ad1a037b1 user-d8bf workspace-ab88@ 6 minutes ago, lasted 10 milliseconds
│  edit commit f8de2f81ac39b5a1c7f14e52000079df353ec4c7
│  (redacted)
○  b0cca05d29a0 user-d8bf workspace-ab88@ 6 minutes ago, lasted 34 milliseconds
│  abandon commit 8b5302fdee2e9b0377cea5216070305f3e83d624
│  (redacted)
○  126f0e992876 user-d8bf workspace-ab88@ 14 minutes ago, lasted 31 milliseconds
│  commit ee769f7934162e1dd874f8a914d9b73b7a0975d7
│  (redacted)
○  194f3b84a07a user-d8bf workspace-ab88@ 15 minutes ago, lasted 14 milliseconds
│  untrack paths
│  (redacted)
○  a919fccff3c7 user-d8bf workspace-ab88@ 15 minutes ago, lasted 15 milliseconds
│  snapshot working copy
│  (redacted)
○  008f82cb9f84 user-d8bf workspace-ab88@ 15 minutes ago, lasted 14 milliseconds
│  snapshot working copy
│  (redacted)
○  15e70e3d3376 user-d8bf workspace-ab88@ 15 minutes ago, lasted 30 milliseconds
│  commit d7f7f197829b54dec93c35a7d85292183fff89be
│  (redacted)
○  a72462e78c95 user-d8bf workspace-ab88@ 16 minutes ago, lasted 15 milliseconds
│  snapshot working copy
│  (redacted)
[...]
xobs18d ago

The issue appears to be that .DS_Store was conflicted (which I didn't notice) and I tried to do jj resolve to see what was conflicted.

Removing the file is enough to fix the conflict (and the file shouldn't have been added in the first place -- my fault), but seeing "this should not happen" seems like not a very good thing.

josephlou518d ago

I tried to do jj resolve to see what was conflicted

Note that you can do jj resolve --list to see the paths of the conflicted files. I guess this error occurred because the built-in diff editor (scm-record) tried to open .DS_Store, but just listing the conflicted paths should have worked.

xobs18d ago

Thanks for the tip, I should probably have done that instead. I think I was more caught off guard by the "this should not happen" message, which I see you're addressing.