####Urgent help required### During checkpointing, ...
# troubleshooting
c
####Urgent help required### During checkpointing, if the folder where snapshot is to be saved is already present. Like in my case “chk-1” is the folder where snapshot is to be saved is already present. I get below exception & post that job gets restarted.
Copy code
WARN  org.apache.flink.runtime.checkpoint.CheckpointFailureManager [] - Failed to trigger or complete checkpoint 1 for job 000000006e6b13320000000000000000. (0 consecutive failed attempts so far)
org.apache.flink.runtime.checkpoint.CheckpointException: Failure to finalize checkpoint.

Caused by: java.io.IOException: Target file file:/opt/flink/pm/checkpoint/000000006e6b13320000000000000000/chk-1/_metadata already exists.
    at org.apache.flink.runtime.state.filesystem.FsCheckpointMetadataOutputStream.getOutputStreamWrapper(FsCheckpointMetadataOutputStream.java:168)
Expectation: Ideally it should either skip this folder name use another or overwrite the content of the existing folder. Can someone help me out to know if this is expected behaviour or there is some workaround available?
m
Why should it skip? Checkpointing is an internal mechanism, you shouldn’t influence it
c
by skip I meant either use another folder name or overwrite the contents.. But atleast do something, rather it throws an exception & job gets restarted
m
I don’t understand how you ended up in this situation
Did you have a failure and tried to restart?
And what Flink version are you using?
c
No failure happened 1.16.0 version
when you start the flink job using savepoint/checkpoint flag, if the checkpoint folder already exists this exception occurs & job gets restarted
if you see the casued by statement; “Target file file:/opt/flink/pm/checkpoint/000000006e6b13320000000000000000/chk-1/_metadata already exists.” here the folder “chk-1" already exists hence the exception
n
I am using 1.16.1 and have tested starting with savepoint and checkpoint, no issues observed
m
when you start the flink job using savepoint/checkpoint flag
What flag do you mean?
There isn't enough information to answer this question: 1. When did the error occur, is this when after you've starting a job from an existing check/savepoint, or is this for a new job that you started? 2. If you did restart, how did you do that? Did you use https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/cli/#starting-a-job-from-a-savepoint or something else?
c
Answers: a) Error occurs after starting job with an existing check/savepoint. b) We have k8s cluster where we have deployed flink cluster. When exception occurs, job gets restarted and in our code we have defined restart strategy (3 counts). If 3 times job gets restarted, post that k8s pod gets restarted.
m
a) Error occurs after starting job with an existing check/savepoint.
Are you sure that the account you're using to write snapshots to filesystem is also allowed to change and remove objects?
c
yeah, user has proper rights assigned.
hi Martijn, Let me know if you need any additional details.