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

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

Open
aryoda opened this issue Jan 27, 2024 · 18 comments
Open

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

aryoda opened this issue Jan 27, 2024 · 18 comments
Assignees
Labels
Distro-Specific only for certain distributions, desktop environments or display servers Documentation

Comments

@aryoda
Copy link
Contributor

aryoda commented Jan 27, 2024

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 #1382 (comment)

@aryoda aryoda added Distro-Specific only for certain distributions, desktop environments or display servers Feedback needs user response, may be closed after timeout without a response labels Jan 27, 2024
@aryoda
Copy link
Contributor Author

aryoda commented Jan 27, 2024

@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:

if not self.config.canBackup(profile_id):
if self.config.PLUGIN_MANAGER.hasGuiPlugins and self.config.notify():
self.setTakeSnapshotMessage(1,
_('Can\'t find snapshots folder.\nIf it is on a removable drive please plug it in.') +
'\n' +
gettext.ngettext('Waiting %s second.', 'Waiting %s seconds.', 30) % 30,
30)

Looking into canBackup() the problem could be

  • either the configured "mode" is wrong (should be local - no need to mount anything)
  • or the snapshot path does not exist (may be a docker problem if the snapshot folder is mapped to the host OS file system or a permission issue root is not allowed to access the snapshot folder - just grant the folder permissions)
  • or the snapshot "folder" is not a folder but a file

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
Copy link
Member

buhtz commented Jan 27, 2024

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. 🍿 🍸

@Hitro147
Copy link

@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
Copy link
Member

buhtz commented Jan 27, 2024

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
Copy link

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

@buhtz
Copy link
Member

buhtz commented Jan 27, 2024

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

@Hitro147
Copy link

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
Copy link

@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
Copy link
Contributor Author

aryoda commented Jan 28, 2024

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...

@aryoda aryoda self-assigned this Jan 28, 2024
@Hitro147
Copy link

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
Copy link
Contributor Author

aryoda commented Jan 31, 2024

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
Copy link

Hitro147 commented Jan 31, 2024

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
Copy link
Contributor Author

aryoda commented Jan 31, 2024

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

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

@Hitro147
Copy link

Hitro147 commented Feb 1, 2024

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

@aryoda
Copy link
Contributor Author

aryoda commented Feb 1, 2024

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
Copy link
Member

buhtz commented Feb 1, 2024

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
Copy link
Contributor Author

aryoda commented Feb 1, 2024

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

@buhtz buhtz added this to the Upcoming release (1.5.0) milestone Feb 1, 2024
@Hitro147
Copy link

Hitro147 commented Feb 1, 2024

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

@buhtz buhtz removed the Feedback needs user response, may be closed after timeout without a response label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Distro-Specific only for certain distributions, desktop environments or display servers Documentation
Projects
None yet
Development

No branches or pull requests

3 participants