bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
2.01k stars 197 forks source link

Snapshot folder not found (BiT on Mac in a Docker container) #1622

Open aryoda opened 7 months ago

aryoda commented 7 months ago

Hi Developers,

I'm new to open-source contributing and am very excited about contributing to the Back In Time project. However, I've run into a hurdle that I hope you guys can help me with.

I'm currently operating on a Mac, and since Back In Time is designed for Linux, I've been using Docker to create a compatible environment. Also, I am not using the UI version of the project but rather the command line interface through Docker.

Despite following the instructions for taking a snapshot, I continually encounter an error stating that the snapshots folder cannot be found. I've made several attempts to resolve this by creating directories in different locations and adjusting the snapshot path ('profile1.snapshots.path') in the config file. I've experimented with various directory names and paths, but the application still fails to recognize the snapshots folder, and I continue to receive the same error message.

I've attached screenshots illustrating the directory structures I've tried and the error messages encountered.

Any insights into a naming convention, specific directory location, or Docker-related adjustments that I should be aware of would be greatly appreciated.

Thank you for your time and assistance. WhatsApp Image 2024-01-24 at 10 41 55 AM (1)

WhatsApp Image 2024-01-24 at 10 41 55 AM (2)

WhatsApp Image 2024-01-24 at 10 41 55 AM (3)

WhatsApp Image 2024-01-24 at 10 41 55 AM

Originally posted by @Hitro147 in https://github.com/bit-team/backintime/issues/1382#issuecomment-1913261863

aryoda commented 7 months ago

@Hitro147

Officially we don't support Mac and I personally think It will not work without investing a lot of time (which we as BiT developers do not have) but I am really interested in your experiences.

The code that prints the Can't find snapshots folder. ... is here:

https://github.com/bit-team/backintime/blob/d583cf8a4b7de4271f897f07a94d0fbe07f9caff/common/snapshots.py#L767-L773

Looking into canBackup() the problem could be

To investigate the problem could you please:

  1. Show me the output of backintime --diagnostics
  2. Provide the BiT config file with the profile here (anonymize sensitive data if required) before uploading it here
  3. Upload the dockerfile to understand the setup
  4. Start BiT with the --debug option to see the full details of what is happening till the error occurs

PS: It also looks like notify-send is not installed in your docker container

buhtz commented 7 months ago

There are more then just technical reasons that Apple products not supported. But why do you use BIT on a Mac? Isn't there TimeMachine? What is the outstanding fancy feature that you like on BIT that is not available in a native Apple software?

I am really interested in the "--debug" output. :popcorn: :cocktail:

Hitro147 commented 7 months ago

@aryoda, I'll try the suggestions made and get back to you 😄

@buhtz, I was searching for beginner-friendly projects to contribute to, but unfortunately, I realized that BiT is only compatible with Linux after starting to work on it. However, I believed that solving issue #1382 would be a great starting point and learning opportunity for me even if I was on Mac.

But now I'm second-guessing my choice 😅 .

buhtz commented 7 months ago

So your initiative is based on the GoodFirstIssue label? Do you ask for mentoring?

So you don't use BIT regularly on your Mac?

Hitro147 commented 7 months ago

Yes, I started this because of the GoodFirstIssue label. And no I don't use BiT.

buhtz commented 7 months ago

Ah, thanks for this inside. So how do you wish to proceed?

Hitro147 commented 7 months ago

I plan to investigate as suggested by Aryoda and post the results here. Also, if there are any more suggestions or steps that would help me I would be happy to consider those as well while debugging.

Hitro147 commented 7 months ago

@aryoda, @buhtz please see the attachments for diagnostics, dockerfile, and debug outputs.

As I'm not using the GUI version of BiT, I haven't installed notify-send, which is a desktop notification utility. Let me know if I should install it nonetheless.

config_file.txt debug.txt diagnostics.txt

aryoda commented 7 months ago

profile1.snapshots.include.1.value=/home/root

I think the home folder of root is in /root, not /home/root. Please change this and try it again.

Does the snapshot target folder exist? You can find out the folder via backintime --profile-id 1 snapshots-path and create it if required (I am not sure when this is done automatically ATM - I assume backintime check-config must be called once to create the backup target folder).

Edit: Found it, man backintime-config says:

Run 'backintime check-config' to verify the configfile, create the snapshot folder and crontab entries.

I think I will extend our error message and mention this...

Hitro147 commented 7 months ago

I'm happy to let you know that I was able to fix the issue with the snapshot path for Back In Time in the Docker container on my Mac. Here's a summary of the steps I took:

  1. Determined the correct snapshot path by executing the command:

    /backintime/common/backintime --profile-id 1 snapshots-path

    This provided the necessary path where snapshots should be stored.

  2. Created the directory as per the provided path using:

    mkdir -p /root/snapshots/backintime/HOST/root/1

    This ensured that the specified path exists within the Docker container for Back In Time to access.

  3. Initiated a snapshot operation with the following command:

    /backintime/common/backintime --config /root/.config/backintime/config --profile-id 1 backup

    This triggered the backup process and successfully created the snapshot in the designated directory.

I can confirm that the snapshots are now being saved correctly within the Docker container's filesystem. If this setup needs to be saved beyond the container's lifecycle, we will have to consider linking the snapshot directory to a volume on the host system. Thank you for your support throughout this process.

aryoda commented 7 months ago

Thanks a lot for letting us know how to solve the problem!

Was there a reason to prefer mkdir -p ... over backintime check-config to create the required snapshot directory?

Hitro147 commented 7 months ago

After receiving the snapshot path as SnapshotsPath: /root/snapshots/backintime/HOST/root/1, which was not present in /root, creating the directory solved the issue.

I also ran backintime check-config, which produced the output seen in the image, which somehow did not create the snapshot folder for me, or maybe I did not check properly.

image
aryoda commented 7 months ago

All right, again thanks a lot for your feed back!

Please feel free to close the issue if the reported problem is solved.

Hitro147 commented 7 months ago

@aryoda I'm sorry, but I don't have permissions to close this issue.

aryoda commented 7 months ago

That is strange, you have opened the issue but may not close it...

Anyhow I will close it then after updating our info message about the missing snapshot folder.

buhtz commented 7 months ago

That is strange, you have opened the issue but may not close it...

To what I see you have opened the Issue. Haven't you moved it from somewhere else? Or you might have edited the OPs initial posting?

aryoda commented 7 months ago

Ah yes, I did move the initial comment from another issue into this so @Hitro147 cannot close it...

Hitro147 commented 7 months ago

@aryoda and @buhtz, thank you for your prompt feedback. I'll leave the issue closure to you both. 😄