503 creating a new branch

I’m getting a 503 response when I try to create a new branch.
I’m running gitlab-ce-10.6.4-ce.0.el7.x86_64
We recently installed gitlab-ee as a trial and we have reverted back to gitlab-ce now.
I’m not sure if that is relevant. We have successfully created branches since reverting back to gitlab-ce.
We currently have 13 branches in the project.

Here is what is in /var/log/gitlab/gitlab-rails/production.log

Started POST “/raemis/raemis/branches” for 172.28.6.63 at 2018-04-20 10:46:31 +0100
Processing by Projects::BranchesController#create as HTML
Parameters: {“utf8”=>“✓”, “authenticity_token”=>"[FILTERED]", “branch_name”=>“Clennon_test”, “ref”=>“develop”, “namespace_id”=>“raemis”, “project_id”=>“raemis”}
Started POST “/api/v4/internal/allowed” for 127.0.0.1 at 2018-04-20 10:46:32 +0100
Started POST “/api/v4/internal/pre_receive” for 127.0.0.1 at 2018-04-20 10:46:32 +0100
Started GET “/-/metrics” for 127.0.0.1 at 2018-04-20 10:46:34 +0100
Processing by MetricsController#index as HTML
Completed 200 OK in 2ms (Views: 0.7ms | ActiveRecord: 0.0ms)

Gitlab::Git::CommandError (2:invalid byte sequence in US-ASCII):
lib/gitlab/git/repository.rb:1370:in rescue in gitaly_migrate' lib/gitlab/git/repository.rb:1363:in gitaly_migrate’
lib/gitlab/git/repository.rb:719:in add_branch' app/models/repository.rb:181:in add_branch’
app/services/create_branch_service.rb:10:in execute' app/controllers/projects/branches_controller.rb:55:in create’
lib/gitlab/i18n.rb:50:in with_locale' lib/gitlab/i18n.rb:56:in with_user_locale’
app/controllers/application_controller.rb:330:in set_locale' lib/gitlab/middleware/multipart.rb:95:in call’
lib/gitlab/request_profiler/middleware.rb:14:in call' lib/gitlab/middleware/go.rb:17:in call’
lib/gitlab/etag_caching/middleware.rb:11:in call' lib/gitlab/middleware/read_only/controller.rb:28:in call’
lib/gitlab/middleware/read_only.rb:16:in call' lib/gitlab/request_context.rb:18:in call’
lib/gitlab/metrics/requests_rack_middleware.rb:27:in call' lib/gitlab/middleware/release_env.rb:10:in call’

Completed 503 Service Unavailable in 8938ms (Views: 43.1ms | ActiveRecord: 6.9ms)

If I remove catching the exception in respository.rb, I get the following stack trace:
GRPC::Unknown (2:invalid byte sequence in US-ASCII):
lib/gitlab/gitaly_client.rb:135:in call' lib/gitlab/gitaly_client/operation_service.rb:55:in user_create_branch’
lib/gitlab/git/repository.rb:2147:in gitaly_add_branch' lib/gitlab/git/repository.rb:727:in block in add_branch’
lib/gitlab/gitaly_client.rb:269:in block (2 levels) in migrate' lib/gitlab/gitaly_client.rb:313:in allow_n_plus_1_calls’
lib/gitlab/gitaly_client.rb:262:in block in migrate' lib/gitlab/metrics/influx_db.rb:98:in measure’
lib/gitlab/gitaly_client.rb:260:in migrate' lib/gitlab/git/repository.rb:1366:in gitaly_migrate’
lib/gitlab/git/repository.rb:725:in add_branch' app/models/repository.rb:177:in add_branch’
app/services/create_branch_service.rb:10:in execute' app/controllers/projects/branches_controller.rb:55:in create’
lib/gitlab/i18n.rb:50:in with_locale' lib/gitlab/i18n.rb:56:in with_user_locale’
app/controllers/application_controller.rb:326:in set_locale' lib/gitlab/middleware/multipart.rb:95:in call’
lib/gitlab/request_profiler/middleware.rb:14:in call' lib/gitlab/middleware/go.rb:17:in call’
lib/gitlab/etag_caching/middleware.rb:11:in call' lib/gitlab/middleware/read_only/controller.rb:28:in call’
lib/gitlab/middleware/read_only.rb:16:in call' lib/gitlab/request_context.rb:18:in call’
lib/gitlab/metrics/requests_rack_middleware.rb:27:in call' lib/gitlab/middleware/release_env.rb:10:in call’

Not sure if it’s of any use, but the creating a branch off some branches does work.
However, creating a new branch from most branches fails with the above error.