Source control errors prevent publishing app - help!

gpopp
Kilo Expert

Our dev instance got a clone from our test instance and this seems to have somehow broken source control.
When trying to publish, we get an error dialog:
"An error occurred while executing that operation. Try again, check logs, and contact support if the error persists"

find_real_file.png

System logs show this error:
Error occurred while exporting application : com.glide.sourcecontrol.SourceControlException: org.eclipse.jgit.api.errors.RefNotFoundException: Ref HEAD can not be resolved: com.glide.sourcecontrol.AGitRepository.createBranch(AGitRepository.java:551)
com.glide.sourcecontrol.AGitRepository.createBranch(AGitRepository.java:530)
com.glide.sourcecontrol.AGitRepository.checkout(AGitRepository.java:583)
com.glide.sourcecontrol.AGitRepository.checkout(AGitRepository.java:559)
com.glide.sourcecontrol.worker.git.GitWorkerHelper.initRepo(GitWorkerHelper.java:104)
com.glide.sourcecontrol.worker.git.GitExportApplicationWorker.exportApp(GitExportApplicationWorker.java:151)
com.glide.sourcecontrol.worker.ExportApplicationWorker.execute(ExportApplicationWorker.java:96)
com.glide.sourcecontrol.SourceControlWorker.startWork(SourceControlWorker.java:41)
com.glide.worker.AbstractProgressWorker.startAndWait(AbstractProgressWorker.java:126)
com.glide.worker.HierarchicalProgressWorker.startAndWait(HierarchicalProgressWorker.java:35)
com.glide.worker.BackgroundProgressJob.execute(BackgroundProgressJob.java:59)
com.glide.schedule.JobExecutor.lambda$executeJob$0(JobExecutor.java:113)
com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:116)
com.glide.schedule.JobExecutor.execute(JobExecutor.java:100)
com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:300)
com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$0(SchedulerWorkerThread.java:188)
com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)
com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:188)
com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:102)

We have ensured our credentials are valid and that the repo is undamaged and reachable from our instance.

We would like to completely remove the source control linkage from this app so that we can publish, but there seems to be no way to do this from within studio. Does anyone know how to clear out the repository configuration for an app? What table holds this data?
Thanks!

1 ACCEPTED SOLUTION

gpopp
Kilo Expert

Thanks Maik! I just now did something similar. While setting my application scope to the desired application, I navigated to the sys_app (Custom Applications) table (list view) and found my application. Upon opening the record I had a related list option to "publish to my application repository". This basically performed the "Publish" step in studio without first attempting to update the git repo! Whew! 

View solution in original post

8 REPLIES 8

Maik Skoddow
Tera Patron
Tera Patron

From module "My company applications" open the application and in the related links you find a link to publish your application to an update set (see https://docs.servicenow.com/bundle/paris-application-development/page/build/applications/task/t_Publ...)

Then remove the application, load it again from update set, create a new git new repo and and from Studio push the application to Git.

Sru
Tera Contributor

Maik, is this the only way to recover from this error?

To be honest, I don't know.

I never had such a case and just described an approach which SHOULD work.

Kind regards
Maik

gpopp
Kilo Expert

Thanks Maik! I just now did something similar. While setting my application scope to the desired application, I navigated to the sys_app (Custom Applications) table (list view) and found my application. Upon opening the record I had a related list option to "publish to my application repository". This basically performed the "Publish" step in studio without first attempting to update the git repo! Whew!