Forums

Home / Forums

You need to log in to create posts and topics. Login · Register

file_sync_manager.py error

Pages: 1 2

Hello.

I have a continous error with sync manager:
26/10/2023 18:40:36 ERROR [Errno 2] No such file or directory: '/config/etc/hosts'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/PetaSAN/backend/file_sync_manager.py", line 39, in write_file
file = open(file_path.replace(self.root_path, ''), 'w')
FileNotFoundError: [Errno 2] No such file or directory: '/config/etc/hosts

I have already restarted all "petasan-file-sync" services, but without any success.

Of course, is possible that I have write the wrong path, but now how can I delete from "queue" ?

 

what is output of

ls -l /opt/petasan/config/etc/hosts
ls -l /etc/hosts

systemctl status petasan-file-sync

have you edited /etc//hosts yourself ?

 

root@petasan-08:~# ls -lat /etc/hosts
lrwxrwxrwx 1 root root 29 Oct 25 16:44 /etc/hosts -> /opt/petasan/config/etc/hosts
root@petasan-08:~# ls -lat /opt/petasan/config/etc/hosts
-rw-r--r-- 1 root root 282 Oct 30 09:04 /opt/petasan/config/etc/hosts
root@petasan-08:~# systemctl status petasan-file-sync
● petasan-file-sync.service - PetaSAN File Sync Service
Loaded: loaded (/lib/systemd/system/petasan-file-sync.service; static; vendor preset: enabled)
Active: active (running) since Thu 2023-10-26 18:15:52 CEST; 3 days ago
Main PID: 697159 (files_sync.py)
Tasks: 1 (limit: 77040)
Memory: 18.1M
CGroup: /system.slice/petasan-file-sync.service
└─697159 /usr/bin/python3 /opt/petasan/services/files_sync.py

Oct 30 09:04:40 petasan-08 files_sync.py[697159]: wrote file
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: file_path
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: /opt/petasan/config/etc/hosts
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: Gonna write file
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: wrote file
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: file_path
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: config/etc/hosts
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: Gonna write file
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: wrote file
Oct 30 09:04:40 petasan-08 files_sync.py[697159]: index 46251

Yes, previously (is wrong, i know), i have edited /etc/hosts before stopping file-sync process.
now all is ok, file /etc/hosts and /opt/petasan/etc/hosts are ok on all the nodes, but i continue to have this error on all hosts

on any host with a valid /etc/hosts file
run:
systemctl stop petasan-file-sync
/opt/petasan/scripts/util/sync_file.py /etc/hosts
systemctl start petasan-file-sync

if you still see issues, stop sync service on all nodes
systemctl stop petasan-file-sync

I still have the problem. Petasan tries to sync /config/etc/hosts (that is not present on system).
There is a queue somewhere ?

 

04/11/2023 18:55:18 ERROR [Errno 2] No such file or directory: '/config/etc/hosts'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/PetaSAN/backend/file_sync_manager.py", line 39, in write_file
file = open(file_path.replace(self.root_path, ''), 'w')
FileNotFoundError: [Errno 2] No such file or directory: '/config/etc/hosts'

 

 

This is what happens on my nodes:

root@petasan-04:~# systemctl status petasan-sync-replication-node.service
● petasan-sync-replication-node.service - PetaSAN Sync Replication Node
Loaded: loaded (/lib/systemd/system/petasan-sync-replication-node.service; static; vendor preset: enabled)
Active: inactive (dead)
----

Nov 06 15:18:20 petasan-04 files_sync.py[3103]: index 212050
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: data [{'LockIndex': 0, 'Key': 'PetaSAN/Config/Files/etc/hosts', 'Flags': 0, 'Value': 'MTcyLjE2LjMzLjEzICAgcGV0YXNhbi0wMwoxMjcuMC4wLjEgICBsb2NhbGhvc3QKMTcyLjE2LjMz
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: -------------------------------------
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: updated current_index: 212050
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: file_path
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: /etc/hosts
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: Gonna write file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: wrote file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: file_path
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: /opt/petasan/config/cluster_info.json
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: Gonna write file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: wrote file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: file_path
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: /opt/petasan/config/etc/hosts
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: Gonna write file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: wrote file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: file_path
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: config/etc/hosts
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: Gonna write file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: wrote file
Nov 06 15:18:20 petasan-04 files_sync.py[3103]: index 212050

There should be a file

/opt/petasan/config/etc/hosts

and a sym link /etc/hosts pointing to in

ls -l /etc/hosts
lrwxrwxrwx 1 root root 29 Aug  3 01:53 /etc/hosts -> /opt/petasan/config/etc/hosts

if this was changed, then recreate the  /opt/petasan/config/etc/hosts and create a symlink /etc/hosts point to it via ln -s

This should be done on all nodes. Then on a single node do:

systemctl stop petasan-file-syncano
nano /etc/hosts # make sure file is correct, edit if needed, all management ips of all nodes + localhost
/opt/petasan/scripts/util/sync_file.py /etc/hosts
systemctl start petasan-file-sync

All the nodes are already ok (symlinks and files are correct).

If I follow your instructions, stopping petasan-file-sync and issue  /opt/petasan/scripts/util/sync_file.py /etc/hosts, this is what I have in /opt/petasan/log/PetaSAN.log:
07/11/2023 09:42:19 ERROR [Errno 2] No such file or directory: '/config/etc/hosts'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/PetaSAN/backend/file_sync_manager.py", line 39, in write_file
file = open(file_path.replace(self.root_path, ''), 'w')
FileNotFoundError: [Errno 2] No such file or directory: '/config/etc/hosts'

 

 

Hello.
There is a queue ? A db with the sync operation to do ? Because I still have this continuos error on all my nodes 🙁

 

With all nodes having /etc/hosts a link to /opt/petasan/config/etc/hosts, as in:
ls -l /etc/hosts
lrwxrwxrwx 1 root root 29 Aug 3 01:53 /etc/hosts -> /opt/petasan/config/etc/hosts

Go to a hosts with valid content of /etc/hosts, then run
consul kv delete -recurse PetaSAN/Config/Files
consul kv get -recurse PetaSAN/Config/Files
/opt/petasan/scripts/util/sync_file.py /etc/hosts
consul kv get -recurse PetaSAN/Config/Files

Pages: 1 2