-
Notifications
You must be signed in to change notification settings - Fork 4
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
[APP-7692] Fix empty config errors on new install #73
Conversation
if errors.Is(err, fs.ErrNotExist) { | ||
return StackConfigs(&pb.DeviceAgentConfigResponse{}) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual fix.
if err != nil { | ||
globalLogger.Errorf("error loading config from cache: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be non-fatal always now.
FragmentId: n.Config().FragmentID, | ||
Model: n.Config().Model, | ||
Manufacturer: n.Config().Manufacturer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one fix in config.go, the rest is a related fix around config locking (potential race.) Overlooked during 0.14.0 development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
33eaf6d
to
c1d09e7
Compare
subsystems/networking/scanning.go
Outdated
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 | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should help reduce the flood of "Scanning not allowed while unavailable" messages Eliot and Bill reported.
This reverts commit 1c3d7b9.
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.)