Reputation: 55
Recently, I was put in charge of our ios and android applications. While under the tutelage of the person who was previously maintaining the app, build and deployments were running successfully. We used sourcetree, had a master branch, pulled from that branch and prepended every release either with prod-,stage-,demo-,qa- which was picked up by our fastfile and applied where necessary. The tech we use for building is Codemagic. When I was doing this under supervision it was running successfully and no errors would pop up.
Then, once my colleague left, the app started deploying with adverse effects. Here is where my issue arose: I would create a branch(relevant for both ios and android) lets say demo-1.59.x from here I would push this branch to bitbucket. I connected my bitbucket to codemagic via oauth. At first it started with ios and i thought it was because the matchfile's giturl was pointing to one of his private repos he used to hold certificates, android was working correctly, I switched the git_url to a new certificate generated from the appstore but didn't work. Long story short when I was receiving an error with 403 but the test and prod envs were being deployed to appstore and google play but saying:
Exit status of command 'git push origin refs/tags/demo-1.59.1.157' was 128 instead of 0.
remote: Your credentials lack one or more required privilege scopes.
fatal: unable to access 'our_repo': The requested URL returned error: 403
I have reviewed a lot. I promise. I spent since last Friday(8/1/24), while embarrassed to admit I have been reviewing all resources, trying to upload this with no errors. Again android was working fine not returning 403 but now it does.
Important question, what is codemagic or fastlane doing here? Why is it trying to work with bitbucket again? I have no idea and I have been going through the fastlane docs as well. If you find it or know please inform me.
Generated new certificates in ios Generated new rsa ssh keys also openssl Tried using ssh and https Removed the apps then tried adding again via "Add Application" in Codemagic Disconnected my account on Codemagic from bitbucket then connected again. I have been trying Claude and ChatGPT as well but I think I'm missing something that someone who is experienced in Fastlane and Codemagic can help me understand. I can push/pull/merge. I merge branches into master all the time and make branches from master all the time as well.
Edit I know it is trying to push tags but what's the purpose of using these tags. We use a webview to deploy our mobile app and everything is updated via FE/BE.
Upvotes: 0
Views: 87
Reputation: 3306
your fastlane script is trying to run git push
command. When you sign up or add your repo to Codemagic via OAuth it always has read-only access which clearly from the error message
remote: Your credentials lack one or more required privilege scopes.
I'd suggest to review Android/production workflows to figure out extra authentication steps they perform. Also worth to check environment variables as they can provide read-write credentials. I hope it helps.
Upvotes: 0