-
Notifications
You must be signed in to change notification settings - Fork 271
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
The sequence number is unknown to the server. StatusBadSequenceNumberUnknown (0x807A0000) #270
Comments
This could be related to #189 |
Could you run this with the |
@769139671 could you check if #271 solves your problem? |
@magiconair thank you for your help! |
Does the patch fix the problem? |
not yet, |
This has a smell. Maybe you are getting the wrong error message. Can you capture the the traffic with Wireshark and post it? If you want to send it privately please find me on https://keybase.io/ |
the data captured when the subscription work well :
the data captured when cause error :
how to use debug? I add "opc.Debug()" in my main.go but it did not print anything |
I'm getting this as well, this is with debug logging on and OPC_DEBUG=debug:
This only happens with the first (99% of the time) or second notification of a subscription in my testing. I've tested up to 1000 sequential notifications. @magiconair testing with #271 made no difference. |
I tried reproducing this and wasn't able to on my dev server. What server are you running against? If it's happening right at the start, that makes sense that #271 wouldn't help; that should only help for really long-running sessions. |
@dwhutchison I am using IGS Server (Industrial GateWay OPC Server) |
@magiconair @dwhutchison I updated my IGS Simulation Server, this is a kind of kepwear simulator, and for free. I am looking forward that you can test it. |
I've tested with IGS and a few other servers and I'm still unable to reproduce it. Please provide:
|
@dwhutchison endpoints, err := opcua.GetEndpoints("opc.tcp://localhost:49310")
if err != nil {
log.Fatal(err)
}
opts := []opcua.Option{
opcua.SecurityPolicy("None"),
opcua.SecurityModeString("None"),
opcua.SecurityFromEndpoint(ep, ua.UserTokenTypeAnonymous),
} Wireshark logs of the error: |
Thanks. The wireshark log helped tons. Your publish requests were timing out before the publish response came in. The timeout on the requests was set to 10s but your messages were coming in ~15s later. Can you check with #280 and see if that fixes the issue? |
@dwhutchison Thank you for your help, how to change the timeout longer? I want to make subscription work continuously and persistent |
@dwhutchison It is unreasonable that the timeout was set to 10s. If the value in my IGS Server changed slowly, the gopcua subscription will not receive the message. |
I realize I didn't explain the fix very well, but you're right. 10s is the default timeout for typical Requests that the server responds to immediately (ReadRequest, BrowseRequest, etc.). PublishRequests are different in that the server intentionally holds off responding to them until there's data to report. The stack is aware of this and sets a higher timeout value for PublishRequests based on the subscription parameters. For example, using the settings in the subscribe example, the PublishRequest timeout becomes 25min. Can you please confirm that #280 resolves your problem? |
@dwhutchison Thank you! It have resolved the previous problem: The sequence number is unknown to the server. |
You can adjust it by setting the appropriate parameters in the DefaultSubscriptionMaxKeepAliveCount = 3000
DefaultSubscriptionInterval = 100 * time.Millisecond which turns into a 5-minute timeout. The subscribe example sets an Regardless, you shouldn't need to worry too much about this. The server knows about these as well and will respond with an empty keepalive response if no data is available within this time period. |
When I subscribe tags, it returns an error: The sequence number is unknown to the server. StatusBadSequenceNumberUnknown (0x807A0000)
What the means of this error?
The text was updated successfully, but these errors were encountered: