carderne / signal-export

Export your Signal chats to markdown files with attachments
Other
481 stars 50 forks source link

/Signal/config.json not found in directory /Signal #56

Closed vinnytroia closed 2 years ago

vinnytroia commented 2 years ago

I am opening this as a new issue to my last comment. I have been able to tweak the OSX settings a bit and am getting closer.

First:

set SIGNAL_OUTPUT=~/Downloads/signal-output

set SIGNAL_INPUT=~/Library/Application Support/Signal

then I run:

docker run --rm -it --name signal-export \

-v ${SIGNAL_INPUT}:/Signal \ -v ${SIGNAL_OUTPUT}:/output \ carderne/signal-export:latest

or:

docker run --rm -it --name signal-export -v ${SIGNAL_INPUT}:/Signal -v ${SIGNAL_OUTPUT}:/output carderne/signal-export:latest

Output: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested Error: /Signal/config.json not found in directory /Signal

I can clearly see config.json in my ~/Library/Application Support/Signal folder.

Thanks

carderne commented 2 years ago

Hi @vinnytroia. The problem from your other issue https://github.com/carderne/signal-export/issues/52 and the config issue in this one is probably related to not quoting the paths. There seem to be some annoying inconsistencies in how Docker/bash/macOS/Linux deal with this. The culprit is that space in Application Support.

Try this:

docker run --rm -it --name signal-export \
  -v "~/Library/Application Support/Signal":/Signal \
  -v "~/Downloads/signal-output":/output \
  carderne/signal-export:latest

Or this:

docker run --rm -it --name signal-export \
  -v ~/Library/Application\ Support/Signal:/Signal \
  -v ~/Downloads/signal-output:/output \
  carderne/signal-export:latest
carderne commented 2 years ago

As for the linux/arm64/v8 issue... I'll look into that, might need to build a separate Docker image for ARM users.

EDIT: try running with carderne/signal-export:multi-arch if you get the linux/arm64/v8 error again. (Basically, replace latest with multi-arch in the scripts above.)

Strengthless commented 2 years ago

Same issue.

Currently on Windows 10, using Docker and the .bashrc method.

signalexport () {
    if [[ -z "$1" ]]; then
        echo 'Must provide output path as first parameters'
        echo 'e.g. signalexport output'
    else
        input="$HOME/AppData/Roaming/Signal/"
        output="D:/My files/Downloads/Signal export/"
        shift 1
        winpty docker run --rm -it --name signal-export \
          -v "$input:/Signal" \
          -v "$output:/output" \
          carderne/signal-export:latest $@
    fi
}

The shell script has been modified, due to the following errors that occurred on my end.

  1. the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty' Fixed this issue by adding winpty before the docker command, as suggested by this stackoverflow article.

  2. docker: invalid reference format: repository name must be lowercase. Fixed this issue by adding quotation marks to the -v argument, as suggested by this stackoverflow article.

Now those two errors are gone, but I'm getting Error: /Signal/config.json not found in directory /Signal upon running signalexport output --chats=Helix or signalexport --list-chats, basically any commands. Any idea why this is happening?

carderne commented 2 years ago

Thanks @Strengthless for figuring that out, have made README and helper script a bit better.

As for the error you're still getting...

  1. Are you sure the Signal files are in "$HOME/AppData/Roaming/Signal/"?
  2. If they are, try running the image directly without the helper script:
    winpty docker run --rm -it --name signal-export \
    -v "$HOME/AppData/Roaming/Signal/":/Signal \
    -v "D:/My files/Downloads/Signal export/":/output \
    carderne/signal-export:latest
Strengthless commented 2 years ago

Interesting... but nope, still doesn't work.

image

image

carderne commented 2 years ago

Maybe you need to play around with eg specifying the full path (with C:/... instead of $HOME) or something, but I can't help here. I don't even know what MINGW64 is.

Strengthless commented 2 years ago

As suggested by https://stackoverflow.com/a/53255978, I added an extra slash before the path, and it seemed to be working...?

winpty docker run --rm -it --name signal-export \
          -v "/$input:/Signal" \
          -v "/$output:/output" \
          carderne/signal-export:latest $@

Not sure what it means nor how it works though... But hey, at least it's a solution.

image

Aside from that, in case if anyone ever comes across this I/O disk error: I managed to fix it by simply closing the Signal app. Apparently the database was being accessed by Signal, and probably made the file read-only, causing this error.

Now the script is up and running for me. 👍

vinnytroia commented 2 years ago

Update:

When i try with quotes, i get this: docker: Error response from daemon: create ~/Library/Application Support/Signal: "~/Library/Application Support/Signal" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path. See 'docker run --help'.

when I try the other solution I get this: File "/usr/local/lib/python3.9/site-packages/sigexport/main.py", line 637, in main copy_attachments(src, dest, convos, contacts) File "/usr/local/lib/python3.9/site-packages/sigexport/main.py", line 70, in copy_attachments file_name += "." + att["contentType"].split("/")[1] IndexError: list index out of range

vinnytroia commented 2 years ago

It turns out that your solution worked. docker run --rm -it --name signal-export \ -v ~/Library/Application\ Support/Signal:/Signal \ -v ~/Downloads/signal-output:/output \ carderne/signal-export:latest

I realized that the index out of range just means I never specified which user to export!

Qazzquimby commented 2 years ago

In case it helps anyone, my issue was trying to work through WSL instead of powershell. In wsl the signal folder exists but is empty.

seanwynwins commented 10 months ago

I'm also getting this error. I tried running

docker run --rm -it --name signal-export -v ~/Library/Application\ Support/Signal:/Signal -v ~/Downloads/signal-output:/output carderne/sigexport:latest

and I get the output

Using Docker to extract data, this may take a while the first time!
Error: using Docker method, but is Docker installed?

Seems like there's a FileNotFound error being thrown somehow, but I verified that Docker is installed and running (docker run hello-world works)

seanwynwins commented 10 months ago

Running

docker run carderne/sigexport --source ~/Library/Application\ Support/Signal/ --list-chats

I get the error

Error: ~/Library/Application Support/Signal/config.json not found in directory ~/Library/Application Support/Signal

I checked that the config.json was there, seems like it's failing this check though