Can't select git account? #3

Closed
opened 2025-10-31 14:59:13 -05:00 by GiteaMirror · 16 comments
Owner

Originally created by @slient2010 on GitHub (Jul 30, 2024).

I used latest source compiled and tried to use self-hosted git server. but can't select git account. may I know how to set it or where I can set it? Thanks.

BTW, I have set core config.toml like below.

[[git_provider]]
domain = "git.myselfhosted.dev" # use a custom provider, like self-hosted gitea
accounts = [
	{ username = "mbecker20", token = "access_token_for_account" },
]
Originally created by @slient2010 on GitHub (Jul 30, 2024). I used latest source compiled and tried to use self-hosted git server. but can't select git account. may I know how to set it or where I can set it? Thanks. BTW, I have set core config.toml like below. ```toml [[git_provider]] domain = "git.myselfhosted.dev" # use a custom provider, like self-hosted gitea accounts = [ { username = "mbecker20", token = "access_token_for_account" }, ] ```
GiteaMirror added the setup label 2025-10-31 14:59:13 -05:00
Author
Owner

@mbecker20 commented on GitHub (Jul 30, 2024):

Hi, when Monitor starts up, it will log the configuration. Can you ensure this log matches your configuration file? If not, ensure the file is correctly mounted to the container, see the example command here.

If the configuration is correct, then you can go to the Resource page Git section, and first select your provider from the dropdown:
Screenshot 2024-07-30 at 2 22 37 PM

After you select your custom provider domain, you should see the account in the dropdown here:
Screenshot 2024-07-30 at 2 22 48 PM

Let me know if this solves the issue

@mbecker20 commented on GitHub (Jul 30, 2024): Hi, when Monitor starts up, it will log the configuration. Can you ensure this log matches your configuration file? If not, ensure the file is correctly mounted to the container, see the example command [here](https://docs.monitor.mogh.tech/docs/core-setup#2-start-monitor-core). If the configuration is correct, then you can go to the Resource page Git section, and first select your provider from the dropdown: <img width="986" alt="Screenshot 2024-07-30 at 2 22 37 PM" src="https://github.com/user-attachments/assets/fafe9ca1-0a25-4aeb-b4ad-f03279057b2a"> After you select your custom provider domain, you should see the account in the dropdown here: <img width="976" alt="Screenshot 2024-07-30 at 2 22 48 PM" src="https://github.com/user-attachments/assets/cb432eda-19a9-4722-a173-eec890314a8b"> Let me know if this solves the issue
Author
Owner

@slient2010 commented on GitHub (Aug 1, 2024):

Thank @mbecker20. Yeah, I can see the git_providers configuration while the core starts up. I can select git Provider on web page, but still can't select the account since there is no any accounts show up.

@slient2010 commented on GitHub (Aug 1, 2024): Thank @mbecker20. Yeah, I can see the git_providers configuration while the core starts up. I can select git Provider on web page, but still can't select the account since there is no any accounts show up.
Author
Owner

@mbecker20 commented on GitHub (Aug 1, 2024):

Hm. Is there anything in the browser console log? Does anyone else have this issue?

Keep in mind the accounts in dropdown are filtered to only show ones available on the selected provider

@mbecker20 commented on GitHub (Aug 1, 2024): Hm. Is there anything in the browser console log? Does anyone else have this issue? Keep in mind the accounts in dropdown are filtered to only show ones available on the selected provider
Author
Owner

@slient2010 commented on GitHub (Aug 2, 2024):

yes. I got 500 error from the browser console.

image
@slient2010 commented on GitHub (Aug 2, 2024): yes. I got 500 error from the browser console. <img width="1102" alt="image" src="https://github.com/user-attachments/assets/e4f4323a-c9b5-479c-a7c2-145f6522f246">
Author
Owner

@mbecker20 commented on GitHub (Aug 2, 2024):

Thanks, very helpful. This is a monitor_core bug and I'll release a patch to the Core Image

@mbecker20 commented on GitHub (Aug 2, 2024): Thanks, very helpful. This is a monitor_core bug and I'll release a patch to the Core Image
Author
Owner

@mbecker20 commented on GitHub (Aug 2, 2024):

Fixed with this commit https://github.com/mbecker20/monitor/commit/59cb86d5990ffc4e8959624122c4a8bed6d74352.

Pushed to monitor_core version 1.12.6 image (latest). Just restart with the latest image and it should work.

@mbecker20 commented on GitHub (Aug 2, 2024): Fixed with this commit [https://github.com/mbecker20/monitor/commit/59cb86d5990ffc4e8959624122c4a8bed6d74352](https://github.com/mbecker20/monitor/commit/59cb86d5990ffc4e8959624122c4a8bed6d74352). Pushed to monitor_core version 1.12.6 image (latest). Just restart with the latest image and it should work.
Author
Owner

@LawMixer commented on GitHub (Aug 2, 2024):

On the latest version, I'm getting an error:
https://i.imgur.com/zyvfFjO.png

@LawMixer commented on GitHub (Aug 2, 2024): On the latest version, I'm getting an error: https://i.imgur.com/zyvfFjO.png
Author
Owner

@mbecker20 commented on GitHub (Aug 2, 2024):

I'll need more information to debug this, its coming from the db client and I haven't seen it before. It also won't stop the core api from running, the easy fix would be to delete and recreate the repos in the UI and it should fix it.

if you'd like to help debug it more, you could install Mongo compass, connect to the db, open the repos collection, and send a screenshot.

@mbecker20 commented on GitHub (Aug 2, 2024): I'll need more information to debug this, its coming from the db client and I haven't seen it before. It also won't stop the core api from running, the easy fix would be to delete and recreate the repos in the UI and it should fix it. if you'd like to help debug it more, you could install [Mongo compass](https://www.mongodb.com/try/download/compass), connect to the db, open the repos collection, and send a screenshot.
Author
Owner
@LawMixer commented on GitHub (Aug 2, 2024): https://i.imgur.com/hjgCM0P.png https://i.imgur.com/d64h4yd.png https://i.imgur.com/xhrHiTv.png
Author
Owner

@mbecker20 commented on GitHub (Aug 3, 2024):

Ah, I see you came from v1.11, nice to see.

I still not sure of the issue. The only time I have seen error like this is for "duplicate key insert". But shouldn't be related to field git_account. Could you send a screenshot of the "indexes" tab?

@mbecker20 commented on GitHub (Aug 3, 2024): Ah, I see you came from v1.11, nice to see. I still not sure of the issue. The only time I have seen error like this is for "duplicate key insert". But shouldn't be related to field git_account. Could you send a screenshot of the "indexes" tab?
Author
Owner

@LawMixer commented on GitHub (Aug 3, 2024):

https://i.imgur.com/PkdG74U.png

@LawMixer commented on GitHub (Aug 3, 2024): https://i.imgur.com/PkdG74U.png
Author
Owner

@mbecker20 commented on GitHub (Aug 3, 2024):

thanks, all looks correct.

I see the issue now. This is the offending code: link

The github_account alias (meant for backward compatability) causes deserialization error when you have both github_account and git_account field defined. In compass, just delete the config.github_account field on the Repos which still have it. The next release will remove these aliases.

This is a failure of the migration procedure in upgrading from v1.11, apologies as this is my first release of the migrator. I will take this into account if a migration is necessary in the future. Note that this only affects the Repo resource. Builds and Deployments were migrated correctly.

Thanks @LawMixer !!

@mbecker20 commented on GitHub (Aug 3, 2024): thanks, all looks correct. I see the issue now. This is the offending code: [link](https://github.com/mbecker20/monitor/blob/59cb86d5990ffc4e8959624122c4a8bed6d74352/client/core/rs/src/entities/repo.rs#L109) The `github_account` alias (meant for backward compatability) causes deserialization error when you have both github_account and git_account field defined. In compass, just delete the `config.github_account` field on the Repos which still have it. The next release will remove these aliases. This is a failure of the migration procedure in upgrading from v1.11, apologies as this is my first release of the migrator. I will take this into account if a migration is necessary in the future. Note that this only affects the Repo resource. Builds and Deployments were migrated correctly. Thanks @LawMixer !!
Author
Owner

@mbecker20 commented on GitHub (Aug 3, 2024):

Also, keep in mind best practice is to keep all your configs defined in a resource sync. This way, all configs are external to the db, and can be deleted and synced back in. Also, you can make testing changes in the UI and it will track whats changes, so you can return to how things were in case you don't like the change.

@mbecker20 commented on GitHub (Aug 3, 2024): Also, keep in mind best practice is to keep all your configs defined in a [resource sync](https://docs.monitor.mogh.tech/docs/sync-resources). This way, all configs are external to the db, and can be deleted and synced back in. Also, you can make testing changes in the UI and it will track whats changes, so you can return to how things were in case you don't like the change.
Author
Owner

@LawMixer commented on GitHub (Aug 3, 2024):

Thank you! I'm switching to monitor from Pterodactyl and so far, it has not been easy, but we learn and move on!

Everything is on the same server, but it's on different networks; Wish I could just switch networks from pyero to monitor and be done...hahhah

@LawMixer commented on GitHub (Aug 3, 2024): Thank you! I'm switching to monitor from [Pterodactyl](https://pterodactyl.io/) and so far, it has not been easy, but we learn and move on! Everything is on the same server, but it's on different networks; Wish I could just switch networks from pyero to monitor and be done...hahhah
Author
Owner

@mbecker20 commented on GitHub (Aug 3, 2024):

Thats really awesome to hear. Stay tuned for the next Monitor release, which i will call v1.13 Komodo. Theres going to be a lot of improvements and its getting close. And will be super easy to update, this is why I did the git provider changes before this one, to get the migrator out of the way. So no migrator, will just pull latest and restart core (and run periphery install again... still need to figure out easy way to keep periphery updated. I use puppet for this but the setup of that is not so easy)

@mbecker20 commented on GitHub (Aug 3, 2024): Thats really awesome to hear. Stay tuned for the next Monitor release, which i will call v1.13 Komodo. Theres going to be a lot of improvements and its getting close. And will be super easy to update, this is why I did the git provider changes before this one, to get the migrator out of the way. So no migrator, will just pull latest and restart core (and run periphery install again... still need to figure out easy way to keep periphery updated. I use puppet for this but the setup of that is not so easy)
Author
Owner

@slient2010 commented on GitHub (Aug 3, 2024):

Thanks very much. it worked. @mbecker20

image
@slient2010 commented on GitHub (Aug 3, 2024): Thanks very much. it worked. @mbecker20 <img width="1136" alt="image" src="https://github.com/user-attachments/assets/1f31a24c-d186-4f4a-8e99-5f539857bd65">
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#3