Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing issues pushing to gitlab Oxidized switches congfiguration #3420

Open
ankitsinghvisen opened this issue Feb 21, 2025 · 4 comments
Open

Comments

@ankitsinghvisen
Copy link

Hello,
I'm facing an issue when attempting to push switch configurations to GitLab using Oxidized. The push seems to fail during the push step, but I can manually push the configuration to GitLab without issues. The problem only occurs when trying to push automatically through Oxidized.

Here are the details:

Oxidized version: 0.30.1
OS: Rocky Linux 9.5
GitLab Repo: SSH URL
I’ve configured the push in Oxidized with the following settings:

output:
default: git
git:
user: <>
email: <>
repo: "/home/oxidized/switches-configuration.git"
branch: main

hooks:
push_to_remote:
type: githubrepo
events:
- post_store
remote_repo: GitLab URL # SSH
branch: main
private_key: "/home/oxidized/.ssh/id_rsa"
public_key: "/home/oxidized/.ssh/id_rsa.pub"

However, in Oxidized Logs, I get the following error:

GithubRepo: Pushing local repository(/home/oxidized/switches-configuration.git/)...
I, [2025-02-21T10:32:13.806240 #70261] INFO -- : GithubRepo: to remote: GitLab URL # SSH
E, [2025-02-21T10:32:13.807190 #70261] ERROR -- : Hook push_to_remote (#GithubRepo:0x00007411c96436e8) failed (#<Rugged::NetworkError: unsupported URL protocol>) for event :post_store

I've confirmed that SSH access is working fine, as I can push manually. The error message mentions unsupported URL protocol, which leads me to believe there might be an issue with the way the URL is being handled in the Oxidized configuration.

Has anyone encountered this issue or have suggestions on how to resolve it?

@rmcmilli
Copy link

It's tough to tell from your sanitized config but it looks like the remote_repo URL format for the push_to_remote hook is incorrect. Mine is username@host:/<repo-location> which seems to work fine.

@ankitsinghvisen
Copy link
Author

Thank you for the update, I have written same thing in remote_repo:username@host:/ #repo-location of Gitlab project repository. The problem only occurs when trying to push automatically through Oxidized.

I, [2025-02-21T10:32:13.806240 #70261] INFO -- : GithubRepo: to remote: username@host:/ #repo-location of Gitlab.
E, [2025-02-21T10:32:13.807190 #70261] ERROR -- : Hook push_to_remote (#GithubRepo:0x00007411c96436e8) failed (#<Rugged::NetworkError: unsupported URL protocol>) for event :post_store

@robertcheramy
Copy link
Collaborator

Try the latest oxidized Version. The githubrepo warnings are better. You probably didn't install rugged with ssh support.

@ankitsinghvisen
Copy link
Author

I have updated the packages and re-installed Rugged with ssh support. Now, I am getting an error with a hook while pushing to GitLab. Also, I have tried changing the hooks configuration, but it has not been resolved.

Below is the oxidized error code that I am currently facing, whereas manual push to GitLab is working now with the oxidized hook configuration.

E, [2025-02-26T11:38:15.648506 #86733] ERROR -- : Hook push_to_remote (#GithubRepo:0x00007842e1566e58) failed (#<NoMethodError: undefined method `has_key?' for "[email protected]:ankit.singh/switches-configuration.git":String>) for event :post_store

The git site is not github.com, but a GitLab from a University.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants