Picture of iqbal
Registered 5 years 221 days
iqbal Thursday, 16 December 2021, 10:40 AM
Agenda SDK Dialog: Replicator is not working correctly
Hi
I have Problem with replicator. it is not working correctly. Please See this thread: https://forum.innovaphone.com/moodle2/mod/forum/discuss.php?d=27060#p75596
BR
Iqbal
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Tuesday, 11 January 2022, 02:03 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Hello Iqbal,

was you able to debug the issue as discussed in the SDK Dialog Session?

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 281 days
Sascha Friday, 21 January 2022, 03:22 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Hello Andreas,

I have exactly the same problem. I have already checked that the addColumn method is only called once. This happens in the constructor of my class for the replication.

The strange thing which happen today was the following. I started the debug session in the morning and it worked like it should be. As soon as I restarted the session the same problem ocurred again.

This is the error which I get:

(removed log file)
ERROR: column "guid" specified more than once LINE 1: ...ers (guid,h323,cn,dn,e164,h323email,critical,hide,guid,h323,... ^ 

(Edited by Andreas Fink (innovaphone) - original submission Tuesday, 18 January 2022, 09:01 AM)

Picture of Sascha
Registered 5 years 281 days
Sascha Wednesday, 19 January 2022, 12:00 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Hello Andrea,

so I have tried many things over the last couple of days. I think I have found the problem which leads to this strange behavior of the replicator.

Here are the steps to reproduce it. Can you try this on your end if you are able to reproduce this error.

1) start the and app with a Replicator and extension status update
2) change the status of an extension
3) stop the app
4) change the status of the extension while the app is not active
5) now when the app is started it should lead to the error with the doubled fields in the replicator
6) when you change it back to the old status the error will disappear

I hope this helps you to check if there is an error hidden somewhere.

Regards,
Sascha
Picture of Sascha
Registered 5 years 281 days
Sascha Friday, 21 January 2022, 03:21 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Like I said in the call today here is the logfile when everything is working correctly.

Here the versions I have used for this app:
PBX version:13r2 sr6 IPVA[13.6223], Bootcode[1000], Hardware[0]
APP Manager version: 13r2 136268 sr8
SDK version: 136254

Ther is one error in the first replication which I have to check why we get there such an utf8 error. But the second replication works like it should.

(removed log file)

(Edited by Andreas Fink (innovaphone) - original submission Friday, 21 January 2022, 11:28 AM)

2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Friday, 21 January 2022, 02:24 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
When you can reproduce the Problem, I would like to get a log which shows the wrong ReplicateNextResult message, with the duplicated columns together with the ReplicateStart from the beginning.

I had a look in the PBX code and it looks like, that with a ReplicateStart we re-initialize all the column information. With each ReplicateNext we iterate thru the columns we have received with the ReplicateStart.

So I found no explanation for the duplication.The code here seems to be very simple and straight forward.
Picture of Sascha
Registered 5 years 281 days
Sascha Friday, 21 January 2022, 03:22 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Here is the log when the error first occured. I hope this helps.

(removed log file)

(Edited by Andreas Fink (innovaphone) - original submission Friday, 21 January 2022, 02:58 PM)

Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Friday, 21 January 2022, 02:26 PM in response to Sascha
Re: Agenda SDK Dialog: Replicator is not working correctly
Hello Sascha,

this is the case where the initial problem was not reproduced, correct?

Do you have the a same complete log, especially with the JSON Messages from the PBX, where the initial problem with repeating fields occurs?

This would be very helpful.

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 281 days
Sascha Friday, 21 January 2022, 03:05 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Hello Andreas,

yes the first log I posted was when everything works.

I have posted a log where the error happens.

Regards,
Sascha
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Friday, 21 January 2022, 03:10 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Thanks, this is interessting. The ReplicateStart and ReplicateNextResult is still ok, but the SQL query generated by the replicator lib has this duplication. So the problem is within the lib and not within the PBX code.

I will have a look at the replicator code.
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Friday, 21 January 2022, 03:27 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
I really have not explanation other then AddColumn is called again for each column and the same Replicator instance.

The code for AddColumn is

void Replicator::AddColumn(const char * remote, const char * local, enum ReplicationType type, bool update)
{
columns.push_back(new ReplicatorColumn(remote, local, type, update));
}

And to build the SQL query, we iterate thru columns.

The reason why we don't see this in the ReplicateStart message is, that our Json Library does not allow to add multiple objects with the same name.

Could you add a log output at every place, where you call AddColumn? Something like

debug->printf("%x:AddColumn(%s)", replicator, name);
replicator->AddColumn(...)

If we have a log completely from the call to createReplicator to the error with the wrong SQL statement, we should see if this happens.

I could add code to disallow duplicate AddColumns, but this seems to be a hack to me.
Picture of Sascha
Registered 5 years 281 days
Sascha Friday, 21 January 2022, 04:09 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
I have added this already because I also thought that it will be added multiple times by the application it self.

This line is shown only once in the log everytime:
WhoisOnReplicator->AddColumns

We have a main instance which creates our Replicator and every additional request uses the replicator from this main instance.

I will still add this on monday and send you a new log then.

Do you need both logs again?
One where everything works and one where the error happens?
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Friday, 21 January 2022, 04:37 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
I only need the log from the error case. Good would be to have everything from createReplicator up to the error covered, with output of the replicator pointer to verify it is all the same object.
Picture of Sascha
Registered 5 years 281 days
Sascha Monday, 24 January 2022, 07:52 AM
Re: Agenda SDK Dialog: Replicator is not working correctly
Hello Guntram,

I have send a mail to presales with the logfile.

This is the ticket number: ###331531###

Regards,
Sascha
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Monday, 24 January 2022, 12:22 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
I think I found the cause of the problem: For some reason replicator->Start() is called two times. Maybe there are two Websocket Connections from two App Objects and for both the Start() is called.

This results in two ReplicateStart message being sent.

For each received ReplicateStartResult, the columns are added to the replicator session. This is how we end up with the duplication.

I will think how we can change the statemachine, so that we can ignore a second call to Start().

If you want to continue in the meantime, you could check how these two replicator->Start() calls could happen and avoid this situation.

I add a task in our internal system for this, so I would like to close the related support case. As soon as the task is completed, I will do a post here.
Picture of Sascha
Registered 5 years 281 days
Sascha Monday, 24 January 2022, 12:31 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Thank you, so even if we stop the replicator before we send a new start it will lead this problem?

I will check if I can find the culprit who sends the second request so that we get the second ReplicateStart message.
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Monday, 24 January 2022, 12:37 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Good point. I have not seen the calls to replicator->Stop(). This indeed should clear the columns again. I will add this information to the task.
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Monday, 24 January 2022, 02:46 PM in response to Sascha
Re: Agenda SDK Dialog: Replicator is not working correctly
We checked in a simple fix in 13r2 and 13r3:

119554 - SDK Replicator: Avoid duplicate ReplicateStart messages

When a ReplicateStartResult message is received, the stored columns are deleted as first thing.

With the next service release this is included. If you want to have a build with fix earlier, I think Andreas can help.
Picture of Sascha
Registered 5 years 281 days
Sascha Monday, 24 January 2022, 02:53 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Would that be a service release for the App Manger or the ipva?

I think if I have this release I could test it againt our code base and see if the fix works.
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Thursday, 27 January 2022, 12:51 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
You have to update SDK and build the app with updated SDK to fix this problem. The App Manager and PBX software was not changed in regard of this fix.

Also please check the handling of multiple AppWebsocket connections in your app (should be multiple connections allowed or not?).

Best Regards
Andreas Fink
Picture of Sascha
Registered 5 years 281 days
Sascha Thursday, 27 January 2022, 02:14 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Hi Andreas,

I have updated my sdk but I can reproduce the same error again even with your fixes.

Yes, the app is allowed to have multiple AppWebsocket Connections open at the same time.

I have testet it with these versions.

IPVA: 13r2 sr8 IPVA[13.6268], Bootcode[1000], Hardware[0]
App Manager: 13r2 136268 sr8
SDK Version: 136268

I have used the setup.exe of the SDK to get the new version.

Regards,
Sascha
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Thursday, 27 January 2022, 02:21 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
I checked, the fix is included in build 136284. So it is not part of sr8.
Picture of Sascha
Registered 5 years 281 days
Sascha Thursday, 27 January 2022, 02:39 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Can I download a devloper build of the SDK anywhere?
I would like to check if it works now properly.
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Thursday, 27 January 2022, 06:37 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
Sorry for delay, we had to build an sdk version with this fix first.

You can take this dvl version for testing:

https://cloud1.innovaphone.com/index.php/s/sVrh3UYW7HlTv7U

Just replace files inside of the sdk folder in your project(consider to backup old sdk files).

Best Regards
Andreas
Picture of Sascha
Registered 5 years 281 days
Sascha Friday, 28 January 2022, 07:43 AM
Re: Agenda SDK Dialog: Replicator is not working correctly
Thank you for the link Andreas.

I have tested it with my code base and I can't reproduce the error.

When will the next release of the SDK be?
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Friday, 28 January 2022, 04:06 PM
Re: Agenda SDK Dialog: Replicator is not working correctly
We will release the new sdk with the next service release which usually is on every second mondey of each month:
http://wiki.innovaphone.com/index.php?title=Reference13r2:Release_Notes_Firmware


Best Regards
Andreas Fink
← You can define your color theme preference here