[APP-7692] Fix empty config errors on new install#73
Merged
Otterverse merged 11 commits intomainfrom Feb 24, 2025
Merged
Conversation
Otterverse
commented
Feb 21, 2025
Comment on lines
+198
to
+200
| if errors.Is(err, fs.ErrNotExist) { | ||
| return StackConfigs(&pb.DeviceAgentConfigResponse{}) | ||
| } else { |
Contributor
Author
There was a problem hiding this comment.
This is the actual fix.
Comment on lines
+134
to
+136
| if err != nil { | ||
| globalLogger.Errorf("error loading config from cache: %w", err) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This should be non-fatal always now.
Comment on lines
+42
to
+44
| FragmentId: n.Config().FragmentID, | ||
| Model: n.Config().Model, | ||
| Manufacturer: n.Config().Manufacturer, |
Contributor
Author
There was a problem hiding this comment.
There's one fix in config.go, the rest is a related fix around config locking (potential race.) Overlooked during 0.14.0 development.
ale7714
approved these changes
Feb 24, 2025
33eaf6d to
c1d09e7
Compare
Otterverse
commented
Feb 24, 2025
subsystems/networking/scanning.go
Outdated
Comment on lines
+31
to
+40
| state, reason, err := wifiDev.GetPropertyStateReason() | ||
| if err != nil { | ||
| return errw.Wrap(err, "getting wifi state and reason") | ||
| } | ||
|
|
||
| if state != gnm.NmDeviceStateDisconnected && state != gnm.NmDeviceStateActivated { | ||
| n.logger.Debugf("wifi device state: %s, reason: %s, skipping scan", state, reason) | ||
| return nil | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
This should help reduce the flood of "Scanning not allowed while unavailable" messages Eliot and Bill reported.
This reverts commit 1c3d7b9.
🔗 Link your GitHub account to AtlassianTo enable Code Reviewer, please link your GitHub account to your Atlassian account. Click here to connect your accounts This is a one-time setup that takes less than a minute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Default config wasn't being properly loaded on brand new installs with no cache. This only affects devices which are entirely offline at the time of install and rely on provisioning to get credentials (e.g. manufacturer preinstallation.)
Test build is here: http://packages.viam.com/temp/viam-agent-v0.14.1-rc1-aarch64
Manually copy it to an offline pi (with no existing /opt/viam) and run it with --install. Previously it would fail to enter provisioning. Now it should (as expected.)