Weird problem


Pavel Mencl
 

Guys,
this has been driving me nuts for the last few days and I'm at my wits end.
The problem is that this program misbehaves on my colleagues computer only.
It's fairly simple: 
1. prepares QueryFile, calls WebService, receives responseFile
2. loads the ResponseFile into a ResponseBlob and retrieves number of hits (=correct answers)
3. loads the rest of the data into another blob...you get the drift

It works fine for me but my colleague's machine begs to differ:
The ReponseFile exists, I can load it into the Blob but XmlGet doesn't find anything.
When I run the program again, it works but it on an old copy of the ResponseFile, it doesn't overwritten as it should.
I tried to check if the file is locked but no, it's not.
It's in a windows %temp% folder, I can manipulate any other files there from Magic (write, delete,overwrite) apart from this.
Any ideas, please?
Pavel



Frederik Soete
 

Hi, Pavel,

Perhaps file encoding issues? Ascii or unicode (with or without BOM)? Perhaps the files differ between computers? Have you tried saving blob data on both computers, and comparing them in a hex editor or such like?


Bye,
Frederik Soete

Op vr 20 jan. 2023 14:56 schreef Pavel Mencl <pavel.mencl@...>:

Guys,
this has been driving me nuts for the last few days and I'm at my wits end.
The problem is that this program misbehaves on my colleagues computer only.
It's fairly simple: 
1. prepares QueryFile, calls WebService, receives responseFile
2. loads the ResponseFile into a ResponseBlob and retrieves number of hits (=correct answers)
3. loads the rest of the data into another blob...you get the drift

It works fine for me but my colleague's machine begs to differ:
The ReponseFile exists, I can load it into the Blob but XmlGet doesn't find anything.
When I run the program again, it works but it on an old copy of the ResponseFile, it doesn't overwritten as it should.
I tried to check if the file is locked but no, it's not.
It's in a windows %temp% folder, I can manipulate any other files there from Magic (write, delete,overwrite) apart from this.
Any ideas, please?
Pavel



Pavel Mencl
 

I substituted the ResponseFile on my comp by a copy from the malfunctioning one and it works fine. Hasn't hex-compared them yet.
Pavel


Todd Baremore
 

Pavel,

Try putting a Delay(20) below line 3.
Todd
On 1/20/2023 8:54 AM, Pavel Mencl wrote:

Guys,
this has been driving me nuts for the last few days and I'm at my wits end.
The problem is that this program misbehaves on my colleagues computer only.
It's fairly simple: 
1. prepares QueryFile, calls WebService, receives responseFile
2. loads the ResponseFile into a ResponseBlob and retrieves number of hits (=correct answers)
3. loads the rest of the data into another blob...you get the drift

It works fine for me but my colleague's machine begs to differ:
The ReponseFile exists, I can load it into the Blob but XmlGet doesn't find anything.
When I run the program again, it works but it on an old copy of the ResponseFile, it doesn't overwritten as it should.
I tried to check if the file is locked but no, it's not.
It's in a windows %temp% folder, I can manipulate any other files there from Magic (write, delete,overwrite) apart from this.
Any ideas, please?
Pavel




Pavel Mencl
 

I've already tried up to 20 seconds, no good. But when I re-run the program immediately afterwards, it works fine but on a copy of the ResponseFile returned by the previous call.
Subsequent calls of the web service don't overwrite it. 
If I manually delete the ResponseFile and run the program, the ResponseFile is created but no read into the blob. If I re-run, it's not overwritten but is loaded into the blob.
Pavel


Todd Baremore
 

Try using Postman to call the web service to get more insight into the problem.  https://www.postman.com/downloads/
Todd
On 1/20/2023 10:04 AM, Pavel Mencl wrote:

I've already tried up to 20 seconds, no good. But when I re-run the program immediately afterwards, it works fine but on a copy of the ResponseFile returned by the previous call.
Subsequent calls of the web service don't overwrite it. 
If I manually delete the ResponseFile and run the program, the ResponseFile is created but no read into the blob. If I re-run, it's not overwritten but is loaded into the blob.
Pavel


Pavel Mencl
 

Todd,
the web service calls work fine, the normal state of affairs is that each call gets a unique Id so I can see these call are fine and return correct xml files,only for the debugging I assigned a fixed Id.
I don't understand why the file doesn't get overwritten. Manually I can do it.
Pavel


Frederik Soete
 

Hi Pavel,

another wild guess: do the two machines have different 'run as administrator' checkbox values on the studio exe?

Op vr 20 jan. 2023 16:23 schreef Pavel Mencl <pavel.mencl@...>:

Todd,
the web service calls work fine, the normal state of affairs is that each call gets a unique Id so I can see these call are fine and return correct xml files,only for the debugging I assigned a fixed Id.
I don't understand why the file doesn't get overwritten. Manually I can do it.
Pavel


Pavel Mencl
 

Good call, I've just tried to run it as a local admin, no change.
Pavel


Frederik Soete
 

Hi,

I should have said to also check the runtime, but never mind, will probably have same result...

Op vr 20 jan. 2023 17:01 schreef Pavel Mencl <pavel.mencl@...>:

Good call, I've just tried to run it as a local admin, no change.
Pavel


Pavel Mencl
 

Yes, he's got only runtime.
P.


Frederik Soete
 

Hi again Pavel,

Just looked at your screenshot again. The IO file for your XML, is it first defined and opened in the same task where you retrieve the XML, or in a lower task? Generally I would go for a lower task.

HTH,

FS

Op vr 20 jan. 2023 14:56 schreef Pavel Mencl <pavel.mencl@...>:

Guys,
this has been driving me nuts for the last few days and I'm at my wits end.
The problem is that this program misbehaves on my colleagues computer only.
It's fairly simple: 
1. prepares QueryFile, calls WebService, receives responseFile
2. loads the ResponseFile into a ResponseBlob and retrieves number of hits (=correct answers)
3. loads the rest of the data into another blob...you get the drift

It works fine for me but my colleague's machine begs to differ:
The ReponseFile exists, I can load it into the Blob but XmlGet doesn't find anything.
When I run the program again, it works but it on an old copy of the ResponseFile, it doesn't overwritten as it should.
I tried to check if the file is locked but no, it's not.
It's in a windows %temp% folder, I can manipulate any other files there from Magic (write, delete,overwrite) apart from this.
Any ideas, please?
Pavel



Frederik Soete
 

Pavel,

I wager that must be it!

First time the XML with fixed id cannot be read, because it is not written beforehand (in a higher task than the IO file is opened).

Second time the XML can be read as it already exists, but it cannot be deleted while the IO file is opened.

If the IO file and XMLGET were to be moved to a subtask, the problem would cease.

Typical Magic issue...

I hope you get to solve it this way,

Good weekend,

FS


Op vr 20 jan. 2023 17:28 schreef Frederik Soete via groups.io <frederik.soete=gmail.com@groups.io>:

Hi again Pavel,

Just looked at your screenshot again. The IO file for your XML, is it first defined and opened in the same task where you retrieve the XML, or in a lower task? Generally I would go for a lower task.

HTH,

FS

Op vr 20 jan. 2023 14:56 schreef Pavel Mencl <pavel.mencl@...>:
Guys,
this has been driving me nuts for the last few days and I'm at my wits end.
The problem is that this program misbehaves on my colleagues computer only.
It's fairly simple: 
1. prepares QueryFile, calls WebService, receives responseFile
2. loads the ResponseFile into a ResponseBlob and retrieves number of hits (=correct answers)
3. loads the rest of the data into another blob...you get the drift

It works fine for me but my colleague's machine begs to differ:
The ReponseFile exists, I can load it into the Blob but XmlGet doesn't find anything.
When I run the program again, it works but it on an old copy of the ResponseFile, it doesn't overwritten as it should.
I tried to check if the file is locked but no, it's not.
It's in a windows %temp% folder, I can manipulate any other files there from Magic (write, delete,overwrite) apart from this.
Any ideas, please?
Pavel



Pavel Mencl
 

I'll check later tonight, I had to leave.
Thanks for staying with me.
Best
Pavel


joe moore
 

Are your .ini files the same ?  

   There are settings for treatment of Blobs

 

[MAGIC_SPECIALS]

SpecialNullTerminateBlobs=Y

 

Regards
Joe Moore
Magic Information Systems Inc.
support@...
905 738 9650 x 242

 


Pavel Mencl
 

I assume so (right now I don't have access to the other computer) but if this setting intervened, wouldn't it present itself always? I mean, then I either shouldn't be able to read the blob at all or always? I can read it but not the first time around.
Pavel


Pavel Mencl
 

Frederik,
the top-level task only sets the scene, doesn't open any files (picture below), and call the subtask in RecordSuffix.
It's the subtask that does all the work, defines the blobs, io files...
If there was something wrong with the whole program itself, then it should be faulty everywhere, shouldn't it?
And it works just fine on my box which makes me guess it's got to be something external, either to the application or even Magic itself.
Something like Joe's suggestion regarding the Magic_Specials.
Sorry guys to keep bugging you but this is really driving me nuts.
Pavel


Frederik Soete
 

Hi Pavel 

Looking at your screenshots, I still think it is your tasks. Supertask has logical names, etc., that's ok. Subtask has IO and XMLGET, that's ok too. What is not ok, I think, is to put the File2Blob in the same task as the IO. In my opinion, that would cause the timing issues, if it concerns the same file, both written and read in the same task. I've had such issues bite me before.

Bye,
FS

Op vr 20 jan. 2023 22:35 schreef Pavel Mencl <pavel.mencl@...>:

Frederik,
the top-level task only sets the scene, doesn't open any files (picture below), and call the subtask in RecordSuffix.
It's the subtask that does all the work, defines the blobs, io files...
If there was something wrong with the whole program itself, then it should be faulty everywhere, shouldn't it?
And it works just fine on my box which makes me guess it's got to be something external, either to the application or even Magic itself.
Something like Joe's suggestion regarding the Magic_Specials.
Sorry guys to keep bugging you but this is really driving me nuts.
Pavel


Frederik Soete
 

Correction: Blob2File (which would write the file)

Op za 21 jan. 2023 04:00 schreef Frederik Soete <frederik.soete@...>:

Hi Pavel 

Looking at your screenshots, I still think it is your tasks. Supertask has logical names, etc., that's ok. Subtask has IO and XMLGET, that's ok too. What is not ok, I think, is to put the File2Blob in the same task as the IO. In my opinion, that would cause the timing issues, if it concerns the same file, both written and read in the same task. I've had such issues bite me before.

Bye,
FS

Op vr 20 jan. 2023 22:35 schreef Pavel Mencl <pavel.mencl@...>:
Frederik,
the top-level task only sets the scene, doesn't open any files (picture below), and call the subtask in RecordSuffix.
It's the subtask that does all the work, defines the blobs, io files...
If there was something wrong with the whole program itself, then it should be faulty everywhere, shouldn't it?
And it works just fine on my box which makes me guess it's got to be something external, either to the application or even Magic itself.
Something like Joe's suggestion regarding the Magic_Specials.
Sorry guys to keep bugging you but this is really driving me nuts.
Pavel


Frederik Soete
 

Hi,

Sorry, cancel that last correction. Remote debugging is not easy when sleepyhead mixes up function names. My original point was fine.

Bye,

FS

Op za 21 jan. 2023 04:01 schreef Frederik Soete <frederik.soete@...>:

Correction: Blob2File (which would write the file)

Op za 21 jan. 2023 04:00 schreef Frederik Soete <frederik.soete@...>:
Hi Pavel 

Looking at your screenshots, I still think it is your tasks. Supertask has logical names, etc., that's ok. Subtask has IO and XMLGET, that's ok too. What is not ok, I think, is to put the File2Blob in the same task as the IO. In my opinion, that would cause the timing issues, if it concerns the same file, both written and read in the same task. I've had such issues bite me before.

Bye,
FS

Op vr 20 jan. 2023 22:35 schreef Pavel Mencl <pavel.mencl@...>:
Frederik,
the top-level task only sets the scene, doesn't open any files (picture below), and call the subtask in RecordSuffix.
It's the subtask that does all the work, defines the blobs, io files...
If there was something wrong with the whole program itself, then it should be faulty everywhere, shouldn't it?
And it works just fine on my box which makes me guess it's got to be something external, either to the application or even Magic itself.
Something like Joe's suggestion regarding the Magic_Specials.
Sorry guys to keep bugging you but this is really driving me nuts.
Pavel