In the db folder, this folder “/data/db/key.db/journal/” do not even exist. But still got the same error if I create this folder in advance. The mongo server version is v4.4.6-8. Does anyone have some advice on this ? Thank you.
After some digging, I found out this error is because pbm can not find the fixed journal folder. I saw some discuss about make journal folder configurable a year ago. While on current master branch, journal folder is fixed in /data/db/journal. So I add some softlink to bypass this error and can make physical backup succeed. Wooha~
However, while restoring, the cluster state can not be ready anymore. digging…
I assume you have dbpath assigned to /data/db. Then PSMDB will use /data/db/key.db only if you enabled data at rest encryption. Thus we have situation when data at rest encryption is enabled but /data/db/key.db does not exist.
I have no idea how this happened on you machine. key.db subdir is created when you start PSMDB for the first time with empty dbpath and is never deleted by PSMDB.
Probably you enabled encryption when your dbpath dir was already initialized? This scenario is not supported because existing unencrypted instance cannot be switched to encrypted mode.
Hello, @Igor_Solodovnikov
You are right that my instance enabled data at rest encryption by default. My situation is /data/db/key.db exist while /data/db/key.db/journal does not exist. Since physical backup will copy journal file from /data/db/key.db/journal with data at rest encryption enabled, I have to add a soft link to bypass this error.
Blockquote cd /data/db/key.db && ln -s …/journal journal
Hi @Xiaolu
Has the original issue happened before any pbm restore? I mean it was the first time you’ve tried to run “pbm backup -t physical” that lead to the error, right?
Hello everyone, I am still facing this issue on latest 2.0.5 release while performing a physical backup,
2023-03-29T12:24:42Z I [replicaset/:27019] [backup/2023-03-29T12:24:40Z] mark RS as error get backup files: create backupCursor: (Location31403) Failed to get a file's size. Filename: /var/lib/mongo/collection-102-2653468610188052465.wt Error: No such file or directory:
2023-03-29T12:24:42Z I [replicaset/:27019] [backup/2023-03-29T12:24:40Z] mark backup as error get backup files: create backupCursor: (Location31403) Failed to get a file's size. Filename: /var/lib/mongo/collection-102-2653468610188052465.wt Error: No such file or directory:
2023-03-29T12:24:42Z E [replicaset:27019] [backup/2023-03-29T12:24:40Z] backup: get backup files: create backupCursor: (Location31403) Failed to get a file’s size. Filename: /var/lib/mongo/collection-102-2653468610188052465.wt Error: No such file or directory
The file exists and is owned by “mongod” user :
[root@mongo]# ls -alh | grep -i “collection-102-2653468610188052465.wt”
-rw-------. 1 mongod mongod 36K Mar 29 12:08 collection-102-2653468610188052465.wt
Same thing is happening with 4.2.24 version…
2023-03-30T12:11:56Z I [replicaset/:27018] [backup/2023-03-30T12:11:48Z] mark RS as error upload file /var/lib/mongo/collection-6–5627329573051636936.wt: get file stat: stat /var/lib/mongo/collection-6--5627329573051636936.wt: no such file or directory:
2023-03-30T12:11:56Z D [replicaset/:27018] [backup/2023-03-30T12:11:48Z] set balancer on
2023-03-30T12:11:56Z E [replicaset/:27018] [backup/2023-03-30T12:11:48Z] backup: upload file /var/lib/mongo/collection-6--5627329573051636936.wt: get file stat: stat /var/lib/mongo/collection-6–5627329573051636936.wt: no such file or directory
This is a sharded cluster btw, but it also fails on standard replicaset with 4.2.24 version too, I’ve seen it working in 2.0.3 before upgrading, what could have caused this ? When should I expect to get back from you
Thanks in advance already.
The strange thing is that previously it was an error from PSMDB while opening the cursor (create backupCursor: (Location31403)). But the latest it is from PBM trying to copy the file (get file stat). Although in both cases the root cause is No such file or directory.
Can you check the rights of the data files and if pbm-agents have access to it?
Does /var/lib/mongo/collection-6–5627329573051636936.wt exists on the same node that produced the error? pbm-agent should be run on each replicaset node and have access to the local datadir.
Previous issue was fixed by PSMDB-1119. That is now we are facing another issue.
You are right - the new issue looks very similar to some access rights problem