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

[Error]: Failed to open '*/signal-chats/*.html' for writing. #277

Closed
jathri opened this issue Jan 26, 2025 · 8 comments
Closed

[Error]: Failed to open '*/signal-chats/*.html' for writing. #277

jathri opened this issue Jan 26, 2025 · 8 comments

Comments

@jathri
Copy link

jathri commented Jan 26, 2025

Hello, can I ask what could be causing this error? It occurs even when I run windows 10 cmd with admin privileges.
Havent happend before.
CMD: signalbackup-tools_win "\signal.backup" * --originalfilenames --exporthtml "\signal-chats"
https://github.com/bepaald/signalbackup-tools/releases/tag/20250126-1

@bepaald
Copy link
Owner

bepaald commented Jan 26, 2025

Hm, I'm not sure. I did make a change to the Windows file-opening methods, that probably has something to do with it, but I can't reproduce your result:

C:\Users\User\Desktop\SIGNALBACKUP-TOOLS>signalbackup-tools_win.exe DEV2signal-2024-08-26-10-31-22.backup 744628131555004810022027273047 --originalfilenames --exporthtml "\signal-chats"
 *** Starting log: 2025-01-26 15:57:02 ***
signalbackup-tools (signalbackup-tools_win.exe) source version 20250126.112829 (Win) (SQlite: 3.48.0, OpenSSL: OpenSSL 3.4.0 22 Oct 2024)
BACKUPFILE VERSION: 1
BACKUPFILE SIZE: 210234924
COUNTER: 2704489503
Reading backup file: 100.0%... done!
Database version: 239
Starting HTML export to '\signal-chats'
Dealing with thread 2
Dealing with thread 3
Dealing with thread 5
Dealing with thread 6
Dealing with thread 7
Dealing with thread 8
Dealing with thread 9
Dealing with thread 10
Dealing with thread 11
Dealing with thread 12
Dealing with thread 13
Writing index.html...
All done!

Can you verify this is the same command you are running?

I'm assuming the * in your command is a placeholder for the password, are the * in the error you mentioned also placeholders, or is that literally the error?

I was not familiar with filenames starting with a backslash on windows (\signal-chats), but for me it seems to work. Does it make a difference if you specify the path (C:\signal-chats)?

Thanks for reporting!


edit: Could you also try with this custom version, and show me the exact output:

custom.zip

@jathri
Copy link
Author

jathri commented Jan 26, 2025

Hello, thanks for reply. Here is my reply:
*** Starting log: 2025-01-26 16:45:22 ***
signalbackup-tools source version 20250126.161438 (Win) (SQlite: 3.48.0, OpenSSL: OpenSSL 3.4.0 22 Oct 2024)
BACKUPFILE VERSION: 1
BACKUPFILE SIZE: 46843869
COUNTER: 2233892623
Reading backup file: 100.0%... done!
Database version: 264
Starting HTML export to 'path\signal-chats'
Dealing with thread 1
Dealing with thread 2
WINDOWS_LONG_PATH: input "path\signal-chats/Note to Self (_id2)/Note to Self.html"
WINDOWS_LONG_PATH: output "\?\path\signal-chats/Note to Self (_id2)/Note to Self.html"
[Error]: Failed to open 'path\signal-chats/Note to Self (_id2)/Note to Self.html' for writing.
Have WIN10 PRO. Enabled long paths it using https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
Still does not work. Tried CMD and powershell for signalbackup-tools_win command execution.

@bepaald
Copy link
Owner

bepaald commented Jan 26, 2025

WINDOWS_LONG_PATH: output "\?\path\signal-chats/Note to Self (_id2)/Note to Self.html"

That is supposed to say \\?\, (that's 2 backslashes at the start). See also here, and:

C:\Users\User\Desktop\SIGNALBACKUP-TOOLS>S:\signalbackup-tools_win_custom.exe DEV2signal-2024-08-26-10-31-22.backup 744628131555004810022027273047 --exporthtml path\signal-chats
 *** Starting log: 2025-01-26 17:06:51 ***
signalbackup-tools (S:\signalbackup-tools_win_custom.exe) source version 20250126.161438 (Win) (SQlite: 3.48.0, OpenSSL: OpenSSL 3.4.0 22 Oct 2024)
BACKUPFILE VERSION: 1
BACKUPFILE SIZE: 210234924
COUNTER: 2704489503
Reading backup file: 100.0%... done!
Database version: 239
Starting HTML export to 'path\signal-chats'
Dealing with thread 2
WINDOWS_LONG_PATH: input "path\signal-chats/DevXZ1C (_id2)/DevXZ1C.html"
WINDOWS_LONG_PATH: output "\\?\C:\Users\User\Desktop\SIGNALBACKUP-TOOLS\path\signal-chats\DevXZ1C (_id2)\DevXZ1C.html"
WINDOWS_LONG_PATH: input "path\signal-chats/DevXZ1C (_id2)/media/Avatar_2.jpg"
WINDOWS_LONG_PATH: output "\\?\C:\Users\User\Desktop\SIGNALBACKUP-TOOLS\path\signal-chats\DevXZ1C (_id2)\media\Avatar_2.jpg"
WINDOWS_LONG_PATH: input "path\signal-chats/DevXZ1C (_id2)/media/Attachment_6_-1.txt"
WINDOWS_LONG_PATH: output "\\?\C:\Users\User\Desktop\SIGNALBACKUP-TOOLS\path\signal-chats\DevXZ1C (_id2)\media\Attachment_6_-1.txt"
[etc...]

Not sure why this is not working for you. Here is another custom version, could you repeat please?

custom.zip

It's also very strange that the 'path' is not converted to an absolute path (path -> C:\dir\path for example, as in my example above. Is the output you are showing edited, or is that literally copy-pasted from what the program outputs?

Thanks!

@jathri
Copy link
Author

jathri commented Jan 26, 2025

That is supposed to say \?
It says so. I probably copied it wrongly.

No path is not literally copy-pasted. Just did not want to share it here publicly.

And new custom version does not work. But thank you for it anyway :)

@bepaald
Copy link
Owner

bepaald commented Jan 26, 2025

It says so. I probably copied it wrongly.

Thanks, I think github is eating the extra backslashes

No path is not literally copy-pasted. Just did not want to share it here publicly.

I understand, but since something is wrong with the path, and I can not reproduce the problem here it would greatly help if you did not edit the path so much. I'm trying to learn something from the output. Would you please, run that last custom version again. Copy the entire output of the program (and the command), and reply here, pasting the entire output in between two lines of ``` (note that is a backtick, not a single quote). Like this:

```
[paste output here]
```

Then, just carefully replace any usernames, or contact names with xs, without changing the rest of the output?

I think I will probably revert the change I made earlier today, but I just want the proper output to be able to continue investigating.

Thanks!

@bepaald
Copy link
Owner

bepaald commented Jan 27, 2025

I have reverted the windows longpath-change I made yesterday. Everything should work as it did before again, please let me know if it doesn't! If it works again, this issue can be closed.

I'm still curious about the exact output of the custom version from yesterday, but only if you're willing of course.

Thanks!

@bepaald
Copy link
Owner

bepaald commented Jan 29, 2025

Closing this, as I think it was solved a few days ago. But please let me know if you are still seeing problems. Thanks for reporting!

@bepaald bepaald closed this as completed Jan 29, 2025
@jathri
Copy link
Author

jathri commented Jan 31, 2025

It works :) Thank you.

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

No branches or pull requests

2 participants