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

Great that you found a solution! Maybe you could mark my answer as correct answer? Thank you!

gpopp
Kilo Expert

For anyone wishing to Disconnect an app from source control (which you can't do inside of Studio):

Navigate to:

https://<YourInstanceName>.service-now.com/nav_to.do?uri=%2Fsys_repo_config_list.do
Find the application record you want to remove from source control, click on the select box and choose "delete" from the "Actions on selected rows...." drop-down.
You'll get a dire warning of all the things that will be deleted, but you can go ahead from there and do it.

limedzeze
Giga Contributor

This has been the solution for a few different problems we have run into, so thank you for posting this.

Tim Woodruff
Mega Guru

Changing the repo your application is associated with is possible, but not very intuitive, @gpopp mentioned; almost actively obfuscated. I just wrote an article on how to do do it, here.