Git push and branch failures

A Cloudera Migration Assistant migration that writes to a Git repository fails when the Git token cannot write to the repository, when the token has expired, or when the branch does not exist. Code Migrator can show a job as successful even when a push to the built-in Git server has failed, so check the branch.

Symptoms

One or more of the following:

  • A step that pushes to Git fails with an authentication error.
  • The status of a Code Migrator job is SUCCESS, but the branch does not exist in the built-in Git server.
  • Git rejects the base branch that you selected.
  • The status of the Git Connection is Error.

Git token cannot write

A step of a plan execution that pushes to Git needs a token that can write to the contents of the repository. A token with read-only access, or one that has expired, fails when it pushes. A Code Migrator job needs only read access to your own repository, because Code Migrator pushes only to the built-in Git server.

Solution

  1. In the Git provider, check that the token is valid and that it can write to the repository contents.
  2. In Cloudera Migration Assistant, open the General tab of the cluster.
  3. Edit the Git Connection.
    See Managing user connections.
  4. Enter the new Git Token.
  5. Click Test Connection.
  6. Run the step again.

Repository URL or base branch is wrong

A push fails when the repository URL or the user name in the Git Connection is wrong, or when the base branch does not exist.

Solution

  1. Check Repository URL and Git Username in the Git Connection.
  2. Check that the base branch exists in the repository.
    If someone deleted it, restore it, or select another branch.
  3. Run the step again.

Job shows success, but branch does not exist

Code Migrator writes the output to a new branch in the built-in Git server. With Use local git server turned on, the branch is in the repository that you selected in the built-in Git server. Otherwise, the branch is in the copy of your repository in the CMA-Workspace organization. Code Migrator never pushes to your own repository. It checks that it can push to the work branch before it changes any code, but if a later push fails, the status of the job can still be SUCCESS.

Solution

  1. In the built-in Git server, check whether the output branch exists.
    See Reviewing output on Git branches.
  2. If the branch does not exist, check that the built-in Git server is running, and create a new job.
    See Creating refactor jobs.

Job shows success, but code does not build

A job can report success when the build of the code fails. This is a known issue. For CMA-4975, see Known issues and limitations in Cloudera Migration Assistant 2.0.0.

Solution

Check the output branch after each job, and build and test the code yourself before you use it. See Reviewing output on Git branches.