0

I've been trying to merge a source branch with a target branch, but have consistently gotten the following error message on my failed job(s):

$ firebase use project_name --token $FIREBASE_TOKEN

Error: Invalid project selection, please verify project project-name exists and you have access. 
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

I have followed the advice from this thread and logged out/in from Firebase to use the project again, which unfortunately hasn't worked:

firebase logout

firebase login

firebase use project_name

I've triple-checked that I'm using the correct project name in Firebase, rather than the name of my Gitlab repo.

Unsure if it's related, but when setting up the merge request, GitLab notes that The source branch is 3 commits behind the target branch. I don't believe this is part of the issue, but worth bringing up.

Merging branches has never been an issue until today, and this is the first time I'm seeing this particular error causing the failed jobs. Any advice is appreciated


EDIT:

I added a screenshot image of the projects list, showing I've logged into the necessary Project by Project ID on Firebase. Everything should be connected, but I can't see what I'm missing that's causing the failed jobs.

enter image description here

UPDATE:

I've added firebase projects:list within the pipeline editor and get the following error message.

enter image description here

The issue I have here is I cannot find a firebase-debug.log file, after searching ways to find it, and trying to recreate the file by commenting out # firebase-debug.log* in my .gitignore file and running firebase init to try solutions from posts like this. Any thoughts on the original merging issue or how to find firebase-debug.log to move closer to a solution are greatly appreciated.

enter image description here

Henrik
  • 191
  • 1
  • 17
  • What happens if you run `firebase projects:list` inside the pipeline? – sytech May 11 '22 at 23:35
  • I've been trying to add `firebase projects:list` to the `master` and `develop` branches of the CI/CD pipeline editor on GitLab but get the error message `The GitLab CI configuration could not be updated. You are not allowed to push into this branch`. I believe I need to work around permissions so will have to try this out in the next day or two when I can get that sorted. – Henrik May 12 '22 at 03:43
  • I added and committed the change successfully on a separate branch in the editor (let's call it `merge_test`) and retried a pipeline job merging `merge_test` to `develop` again. But the output of the job doesn't run `firebase projects:list` so I'm assuming the editor is still using `master` or `develop` branch of editors. – Henrik May 12 '22 at 03:46
  • @sytech added some additional updates to the original post from your suggestion – Henrik May 15 '22 at 22:53

1 Answers1

0

The setup appears incorrect for CI; eg. one doesn't need to pass $FIREBASE_TOKEN.
The issue might even stem from, that you use --token once and then not anymore.

Please refer to the user manual: https://github.com/firebase/firebase-tools/#general
Using a service account might be the least troublesome.

There's also a login --reauth option; and login:ci.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
  • Appreciate the advice, I'll look into this and your original comment's suggestion today – Henrik May 23 '22 at 18:20
  • Well, with the `firebase-debug.log` it would be easier; without it I could only provide hints. – Martin Zeitler May 23 '22 at 19:00
  • Yeah, that's what I've been trying to find for the past hour, I've tried running `firebase init` a few times within my repository to recreate the file as well but it's absolutely nowhere. I'll try deleting my folder and re-cloning it before trying to initialize again – Henrik May 23 '22 at 19:48
  • It might be inside the home directory of the user who runs the pipeline ... – Martin Zeitler May 23 '22 at 19:50
  • Unfortunately not in the home directory. It's very odd, it did appear while I was in the middle of initializing my new folders but after Firebase initialization was complete, the file disappeared again. I opened it before it disappeared but it was just a printout of my initialization up to that point – Henrik May 23 '22 at 20:01
  • I'm running `firebase init` again now to catch it before it finishes initialization and will update the original post with the printout – Henrik May 23 '22 at 20:03
  • The `firebase-debug.log` file is enormous and exceeds the character limit. Is there a particular focus of it I can find and add to the original post that would be most helpful? – Henrik May 23 '22 at 20:16
  • Usually only the last few lines which matter. While I just found this one answer, which explains how to change the user: https://stackoverflow.com/a/62722622/549372 ...but one can as well give that user a login shell, login and do whatever one wants, then remove the login shell again. This: `--syslog --user gitlab-runner` suggests, that it should log to syslog. Without much debug information this all is mere guessing and the source of confusion might be that you set up things for yourself and not user `gitlab-runner`. – Martin Zeitler May 24 '22 at 05:19