Bitbucket submodule update periodically fails but clone doesn't - bitbucket

After cloning a repo in Bitbucket that has submodules, once in a few weeks, following happens for several minutes to several hours:
One of the repositories that is a submodule fails to clone with git submodule update --init --jobs 16 --force. When that happens, it's only one out of all the submodules and it's that same repository until the problem goes away. Next time it will be a different one. When that happens, repository clones work fine with git clone - just the submodule way of cloning that fails.
Number of jobs doesn't matter. --jobs=1 works in the same way.
Git version doesn't matter (tried several different ones).
Bitbucket access log isn't helpful. Entries are same pretty much for both success and failure in atlassian-bitbucket-access.log.
The URL in .gitmodules is correct and no proxy server is being used.
Bitbucket version is 5.16.5
The git error: fatal: the remote end hung up unexpectedly
The log entry in Bitbucket access log:
10.128.146.44 | ssh | i#WMYO89x939x37670172x5 | username | 2022-05-12 15:39:00,596 | SSH - git-upload-pack '/project/repo.git' | "SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8" | - | - | - | - | - | 1fdp8p1 |
10.128.146.44 | ssh | o#WMYO89x939x37670172x5 | username | 2022-05-12 15:39:00,629 | SSH - git-upload-pack '/project/repo.git' | "SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8" | 0 | 1269 | 438198 | cache:hit, clone, protocol:1, ssh:user:id:951 | 33 | 1fdp8p1 |
While trying out the https cloning, following error comes up:
fatal: remote error: upload-pack: not our ref <a git hash here that points to a commit abject>

Related

iOS Gitlab authentication failed for Fastlane command sync_code_signing

I'm trying to setup fastlane for an iOS project which has one Git repo for the project and the project contains multiple targets for "different" apps based on the same source code.
I created a second git repo for the signing certificates which should be synced with match, but i don't know where to set the auth stuff for it, because my lane throws the error below.
I start the lane signing which contains sync_code_signing
% fastlane signing --env ENVIRONMENTNAME
and i get the following output
[⠙] 🚀 Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
[✔] 🚀
[07:43:16]: Loading from './fastlane/.env.ENVIRONMENTNAME'
[07:43:16]: fastlane detected a Gemfile in the current directory
[07:43:16]: However, it seems like you didn't use `bundle exec`
[07:43:16]: To launch fastlane faster, please use
[07:43:16]:
[07:43:16]: $ bundle exec fastlane signing
[07:43:16]:
[07:43:16]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[07:43:18]: ------------------------------
[07:43:18]: --- Step: default_platform ---
[07:43:18]: ------------------------------
[07:43:18]: Driving the lane 'signing' 🚀
[07:43:18]: -------------------------------
[07:43:18]: --- Step: sync_code_signing ---
[07:43:18]: -------------------------------
[07:43:18]: Successfully loaded 'PROJECTDIR/fastlane/Matchfile' 📄
+--------------+----------------------------------------------------+
| Detected Values from './fastlane/Matchfile' |
+--------------+----------------------------------------------------+
| git_url | https://gitlab.com/TEAMID/apple-certificates.git |
| storage_mode | git |
+--------------+----------------------------------------------------+
+--------------------------------+----------------------------------------------------+
| Summary for match 2.198.1 |
+--------------------------------+----------------------------------------------------+
| type | development |
| readonly | false |
| generate_apple_certs | true |
| skip_provisioning_profiles | false |
| app_identifier | ["APPID"] |
| username | USERID |
| team_id | TEAMID |
| team_name | TEAMNAME |
| storage_mode | git |
| git_url | https://gitlab.com/TEAMID/apple-certificates.git |
| git_branch | master |
| shallow_clone | false |
| clone_branch_directly | false |
| keychain_name | login.keychain |
| force | false |
| force_for_new_devices | false |
| include_all_certificates | false |
| force_for_new_certificates | false |
| skip_confirmation | false |
| skip_docs | false |
| platform | ios |
| derive_catalyst_app_identifier | false |
| fail_on_name_taken | false |
| skip_certificate_matching | false |
| skip_set_partition_list | false |
| verbose | false |
+--------------------------------+----------------------------------------------------+
[07:43:18]: Cloning remote git repo...
[07:43:18]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
Cloning into '/var/folders/wf/_fzyy4y52hq4ssl02xmwwkx80000gn/T/d20211118-79026-m9y5x8'...
remote: The project you were looking for could not be found or you don't have permission to view it.
fatal: repository 'https://gitlab.com/TEAMID/apple-certificates.git/' not found
[07:43:19]: Exit status: 128
[07:43:19]: Error cloning certificates repo, please make sure you have read access to the repository you want to use
[07:43:19]: Run the following command manually to make sure you're properly authenticated:
[07:43:19]: $ git clone https://gitlab.com/TEAMID/apple-certificates.git /var/folders/wf/_fzyy4y52hq4ssl02xmwwkx80000gn/T/d20211118-79026-m9y5x8
+------------------+---------+
| Lane Context |
+------------------+---------+
| ENVIRONMENT | ENVIRONMENTNAME |
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | |
| LANE_NAME | signing |
+------------------+---------+
[07:43:19]: Error cloning certificates git repo, please make sure you have access to the repository - see instructions above
+------+-------------------+-------------+
| fastlane summary |
+------+-------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------+-------------+
| 1 | default_platform | 0 |
| 💥 | sync_code_signing | 0 |
+------+-------------------+-------------+
[07:43:19]: fastlane finished with errors
[!] Error cloning certificates git repo, please make sure you have access to the repository - see instructions above
Do I have to install gitlab-runner locally for that?
I do not need to automate the process with gitlab-ci file right now, i'm fine calling the fastlane commands via console.
Do I have to install gitlab-runner locally for that? I - of course not.
You obviously don't have access to the git repository that the match uses.
Try cloning match repository directly, you may simply not be in VPN.

Cannot determine if team is App Store or Enterprise via the App Store Connect API (yet)

I am maintaining an app that is deployed to the app store. We are using Fastlane and our certificate and provisional profile has expired.
I'm trying to use fastlane match to generate a new certificate. I have deleted the expired certificates in the Git repo that Fastlane points to.
Running fastlane match, I get the following error:
[16:50:09]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
[16:50:10]: Checking out branch master...
[16:50:10]: [32m🔓 Successfully decrypted certificates repo[0m
[16:50:10]: Verifying that the certificate and profile are still valid on the Dev Portal...
[16:50:10]: Creating authorization token for App Store Connect API
[16:50:11]: [33mCouldn't find a valid code signing identity for distribution... creating one for you now[0m
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| [32mSummary for cert 2.177.0[0m |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| platform | ios |
| development | false |
| generate_apple_certs | true |
| force | true |
| api_key_path | **** |
| username | redacted |
| team_id | redacted
| keychain_path | /Users/jenkins/Library/Keychains/login.keychain-db |
| keychain_password | ******** |
| skip_set_partition_list | false |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
[16:50:11]: Creating authorization token for App Store Connect API
+---------------+------+
| [33mLane Context[0m |
+---------------+------+
| PLATFORM_NAME | |
| LANE_NAME | beta |
+---------------+------+
[16:50:11]: [31mCannot determine if team is App Store or Enterprise via the App Store Connect API (yet). Set 'in_house' on your Spaceship::ConnectAPI::Token. Or set 'in_house' in your App Store Connect API key JSON file. Or set the 'SPACESHIP_CONNECT_API_IN_HOUSE' environment variable to 'true'. View more info in the docs at https://docs.fastlane.tools/app-store-connect-api/[0m
Wondering if anyone has seen this before and has any idea what it means?
Thanks
PS - first time posting so appreciate any tips
UPDATE
I have managed to resolve this issue. Our build goes through Jenkins so I had to add in_house:false to our App Store Connect API key JSON file.
UPDATE
I have managed to resolve this issue. Our build goes through Jenkins so I had to add in_house:false to our App Store Connect API key JSON file.

Filecoin Textileio Powergate Not Enough Miners from Reputation Module to Satisfy The Constraints Error

I am running WSL Ubuntu 20.04 (Version 2 with Docker Desktop Support) within Windows 10 Pro Version 21H1
The steps are as follows:
git clone https://github.com/textileio/powergate.git
cd powergate/
cd docker/
nano docker-compose.yaml where I added "["lotus", "daemon", "--import-snapshot", "https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car"]" between lines 32 and 33.
make up
Waited for the node to finish importing and then syncing.
^C then make down then deleted the line "["lotus", "daemon", "--import-snapshot", "https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car"]" from docker-compose.yaml
make up
Now that the node was running I typed cd .. so I was in the repo's root directory, then make install-pow
with the pow command in my GOPATH I typed pow to make sure pow was linked fine to powd. It was.
pow admin users create
copied the token and ran export POW_TOKEN=<token copied to here>
Then pow wallet addrs and funded the address
I went to the directory behind the folder of my static website which is about 5GB in size.
I typed pow data stage <my-static-site-folder>
After it was finished staging and printed out the CID I typed pow config apply --watch <CID waited a long time while it said the job was executing and then I got...
---------------------------------------+--------------------------------+-------+-------+--------------
<job id here> | JOB_STATUS_FAILED executing | | |
| cold-storage config: making | | |
| deal configs: getting miners | | |
| from minerselector: getting | | |
| miners from reputation | | |
| module: not enough miners from | | |
| reputation module to satisfy | | |
| the constraints | | |
I don't understand what the problem is. I repeated the pow config apply --watch <CID command each time adding the --override flag with several different modifications to a custom config file. The content did appear briefly on IPFS (not Filecoin), but after I continued running the config apply command the site went down from IPFS.
This problem can be fixed by adding miners to the "trustedMiner" entry in the config file because pow doesn't necessary detect miners that fit your specs.
I went to a Filecoin miner info aggregation site (I used "https://filrep.io/") and added miners to the trustedMiner section of the config file used in the apply command to start a Filecoin deal.
For example the "trustedMiners" line in your config file should look like this:
"trustedMiners": ["<Miner Id>", "<Miner Id>","<Miner Id>", "<Miner Id>", ...],
with however many miners you want to add.
Then you would execute the command:
pow config apply --watch <CID> -o -c new-config-file.json
Btw the --watch flag is optional as it just allows you to see the status of the deal in real time.

How to get my current branch name from where I am pushing the code to remote server in a pre-receive hook?

I am trying to get the current branch name from where I am pushing the code to the branch in the remote server .
Example: My local branch name is s095_Development and I am pushing the code from my local to master .
I want to get the local branch name in my pre-receive hook.
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
current_branch=$(git rev-parse --abbrev-ref HEAD | cut -d'_' -f1 | cut -d'/' -f3 )
current_branch=$(git name-rev --name-only HEAD | cut -d'_' -f1 | cut -d'/' -f3 )
I have used all the above but nothing seems to work for me - I am not able to get the current branch name.
Use the following command in the directory where your project is.
git branch
When using git push, it pushes to that branch but in the remote server. Thus, if you are currently in master, you'll be pushing to remotes/origin/master.
This is working for me using PHP executing a pre-receive hook on server
#!/usr/bin/php
<?php
$stdin = trim(fgets(STDIN));
$branchName = end(explode('/', end(explode(' ', $stdin))));

Spring Cloud service Look up error: Load balancer does not have available server for client

I've been playing with a Spring Cloud app consisting of a config server, a discovery server (Eureka) and a Feign client with Ribbon (internally used by Feign). I've 2 services, a movie-service and a daily-update-service. The intent is to provide a daily update of popular movies, news and weather in one place.
Problem I'm having is that the movie-service Feign client is not able to find it from daily-update-service. It errors out with the following:
Caused by: java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: movie-service
daily_update_service_1 | at org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:59) ~[spring-cloud-netflix-core-1.1.0.M4.jar:1.1.0.M4]
daily_update_service_1 | at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:95) ~[feign-core-8.12.1.jar:8.12.1]
daily_update_service_1 | at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:74) ~[feign-core-8.12.1.jar:8.12.1]
daily_update_service_1 | at feign.hystrix.HystrixInvocationHandler$1.run(HystrixInvocationHandler.java:54) ~[feign-hystrix-8.12.1.jar:8.12.1]
daily_update_service_1 | at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:294) ~[hystrix-core-1.4.21.jar:1.4.21]
daily_update_service_1 | ... 21 common frames omitted
daily_update_service_1 | Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: movie-service
daily_update_service_1 | at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:468) ~[ribbon-loadbalancer-2.1.0.jar:2.1.0]
daily_update_service_1 | at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.1.0.jar:2.1.0]
daily_update_service_1 | at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.1.0.jar:2.1.0]
My debugging so far shows that the DomainExtractingServerList is trying to do a look up by VIP, which's movie-service and coming up with no servers. The services are registered in Eureka and I can see them on the Eureka dashboard.
I'm not sure what pieces of the code are relevant so I'm posting a link to the Github project. Assuming you've Docker and Docker Compose installed, the easiest way to get it up and running is to clone the project and then follow the following instructions. These instructions are for a Mac/Linux OS, adapt them if necessary to Windows. I'll provide specific code snippets if someone wants to see it here instead of looking in the code.
cd daily-update-microservices.
Replace all occurences of my docker host IP with yours. You can use this command: grep -rl '192.168.99.107' . | xargs perl -pi -e "s/192\.168\.99\.107/$(echo $DOCKER_HOST | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}')/"
Run ./gradlew clean buildDockerImage
Run docker-compose -f daily-update-service/docker-compose.yml up.
Once the services come up, do a curl -v http://$(echo $DOCKER_HOST | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}'):10000/dailyupdate/movies/popular
Upon further investigation, I found that if eureka.client.fetchRegistry is false, the various shuffle methods in com.netflix.discovery.shared.Applications are not called and hence Applications.shuffleVirtualHostNameMap is never populated. This map is used later for look up in the method Applications.getInstancesByVirtualHostName that then fails.
I don't understand why a client would be forced to download the registry. They may choose to make the network trip each time or get delta when necessary.
I've opened an issue on Github for this. Will wait for their response.

Resources