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

Datasources stuck in sync when using git + ssh from ./manage.py syncdatasource #13812

Closed
jacobw opened this issue Sep 19, 2023 · 3 comments · Fixed by #14608
Closed

Datasources stuck in sync when using git + ssh from ./manage.py syncdatasource #13812

jacobw opened this issue Sep 19, 2023 · 3 comments · Fixed by #14608
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jacobw
Copy link

jacobw commented Sep 19, 2023

NetBox version

v3.6.1

Python version

3.11

Steps to Reproduce

In Data Sources
Add
Name: test
Type: git
URL: git@github.com:netbox-community/netbox.git
Create

docker compose exec netbox ./manage.py syncdatasource test

Expected Behavior

Usually leads to some sort of ssh question or failure, and I would expect the exception to set the status to failed, and then be able to hit sync again.

I'm not sure exactly how NetBox works, but looking at one of the exceptions...
core.exceptions.SyncError: Fetching remote data failed (HangupException):

class SyncError(Exception):
pass

Does this mean the status is not being reset correctly due to the status being left as syncing?

Observed Behavior

datasource.status = syncing in nbshell
'syncing' in gui
Sync option is now greyed out and cannot reset status without manually setting it in nbshell:

for d in DataSource.objects.filter(status='syncing'):
d.status = 'failed'
d.save()

@jacobw jacobw added the type: bug A confirmed report of unexpected behavior in the application label Sep 19, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Sep 21, 2023
@jeremystretch jeremystretch self-assigned this Sep 21, 2023
@jeremystretch
Copy link
Member

This appears to be a bug in the syncdatasource management command specifically: Testing using the normal sync (via a background job) returns the status to failed as expected.

@jeremystretch jeremystretch removed their assignment Sep 21, 2023
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: accepted This issue has been accepted for implementation labels Sep 21, 2023
@jacobw
Copy link
Author

jacobw commented Sep 21, 2023

I originally started investigating this as I was getting this issue via the gui, I think that was version 3.6.0. When I did some more testing in my test environment I was only getting the issue via the syncdatasource command, so that all I included in the issue. So either the other issue was just fixed, or there are some other potential code paths in the gui that end up leaving it run sync. I had been working my way through a number of scenarios in my prod environment so not easy to say what the difference was

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Dec 21, 2023
@jeremystretch jeremystretch self-assigned this Dec 26, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation pending closure Requires immediate attention to avoid being closed for inactivity labels Dec 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
2 participants