It sounds like there might be an issue with the SSH key or access token that Laravel Forge is using to communicate with your self-hosted GitLab instance. Here are a few steps you can take to troubleshoot and resolve the issue:
-
Verify SSH Key: Ensure that the SSH key Forge is using is still present and has the correct permissions in your self-hosted GitLab. You might need to re-add the SSH key to your GitLab user's settings if it was somehow removed.
-
Check Repository and Branch Names: Double-check that the repository and branch names are correctly set in Forge. They must match exactly with what is in your GitLab, including case sensitivity.
-
Test SSH Connection: You can manually test the SSH connection from your Forge server to your GitLab server using the following command:
ssh -T [email protected]
Replace your-gitlab-domain.com with your actual GitLab domain. This will help you verify if the SSH connection is working correctly.
-
Project Access Token: If you're using a project access token, ensure that it has the correct scopes (typically
api,read_repository, andwrite_repository) and that it is correctly configured in Forge. You might need to update the token in Forge's source control settings. -
Webhooks: Check if the webhooks from GitLab to Forge are still working. A failed deployment could sometimes be due to webhooks not firing correctly.
-
Manual Git Commands: Try running manual
gitcommands on the Forge server to see if you can access the repository. For example:
git clone [email protected]:namespace/project.git
Replace your-gitlab-domain.com:namespace/project.git with your actual repository path. If this fails, it will give you more information about what might be wrong.
-
Forge Support with Detailed Logs: If none of the above steps work, you may need to contact Forge support again but this time provide them with detailed logs of the errors you're encountering. This could help them pinpoint the issue more effectively.
-
Permissions and Access: Ensure that the user associated with the SSH key or access token in Forge has the necessary permissions to access the repository and perform deployments.
Here's a sample checklist you can follow:
- SSH key is added to GitLab and has correct permissions.
- Repository and branch names are correct in Forge.
- SSH connection from Forge to GitLab works.
- Project access token has the correct scopes and is updated in Forge.
- Webhooks are functioning correctly.
- Manual
gitcommands work on the Forge server. - Detailed error logs are provided to Forge support if needed.
- User permissions are correctly set in GitLab.
By following these steps, you should be able to identify and fix the issue with your custom GitLab access in Laravel Forge.