# A PreSync migration Job reads its password from a Secret stored in the same Application. After the password is rotated in Git, the next sync fails authentication. Why?

Argo CD, Hard (Expert), Troubleshooting & Debugging. https://k8wiz.com/uquiz/a-presync-migration-job-reads-its-password-from-a-secret-stored-in-the-same-application-after-the-password-is-rotated-in-git-the

- A. Hooks cannot read Secrets from their own Application
- B. The hook runs before the Sync phase updates the Secret
- C. Argo CD masks Secret values passed to hook resources
- D. The Secret is pruned before PreSync hooks are created

**Answer:** The hook runs before the Sync phase updates the Secret

**Explanation:** A Secret without a hook annotation belongs to the Sync phase, which starts only after every PreSync hook has succeeded. The migration Job therefore still sees the old password. Keep hook credentials outside the Application, or make the Secret a hook too with a lower sync wave so it lands first.
