Problems with 'copyFile'

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
5 posts • Page 1 of 1
User avatar
wilko0070
Posts: 7
Joined: Wed Oct 11, 2017 11:54 am

Problems with 'copyFile'

Post by wilko0070 » Fri Nov 20, 2020 1:39 pm

I habe problem that the CTRL function 'copyFile' works on the local (test) system correctly but the same code doesn't work anymore on the live system. I always got the message

WCCOActrl19:"WCCOActrl (19), 2020.11.20 10:02:10.205"copyFile() failed, error 3, files: "C:/Data/COAS315/log/manager/MAN_2020_11_20_10_02_10_170.TXT" => "Z:/Auswertungen/Manager/Logs/MAN_2020_11_20_10_02_10_170.TXT".

What does "error 3" mean? Is there a list for this kind of errors?

System: WinCCOA 3.15

dbindernagel
Posts: 83
Joined: Mon Feb 23, 2015 12:34 pm

Re: Problems with 'copyFile'

Post by dbindernagel » Fri Nov 20, 2020 3:20 pm

I'm not sure what WinCC OA is using for their command but if it is using the CopyFile function from windows the error code 3 means "ERROR_PATH_NOT_FOUND". But again they could use different error codes.

I would check if if
1. The source file does really exist at the time the copy command is issued.
2. The destination path does exist.
3. As the destination path looks to be a file share I would also check that the file share is actually available/accessable for the user the CONTROL manager is running on.
4. Check if the user the CONTROL manager is running on has read/write acces to the source file and destination folder.

marijanovicd01
Posts: 1
Joined: Wed Dec 14, 2016 1:59 pm

Re: Problems with 'copyFile'

Post by marijanovicd01 » Mon Nov 23, 2020 10:10 am

Hello dbindernagel,

I'm working together with wilko0070. I've tested the same function on an panel as button (same System/Server).
Doing it this way, the files got copied ono the NAS without a hitch.
I've also checked for error throws (stderr), without success.

Thanks

dbindernagel
Posts: 83
Joined: Mon Feb 23, 2015 12:34 pm

Re: Problems with 'copyFile'

Post by dbindernagel » Mon Nov 23, 2020 12:25 pm

Please check under which user the failing manager is running and make sure this user has access to the fileshare.
For example check if the server is running as a service and verify that the user the service is started with can copy files to the file share.
For clarification: I mean Windows user. Not WinCC OA user.

User avatar
leoknipp
Posts: 2344
Joined: Tue Aug 24, 2010 5:28 pm

Re: Problems with 'copyFile'

Post by leoknipp » Mon Nov 23, 2020 1:49 pm

With the CTRL function access() you can check the access mode for a file or directory.
Possibly you can use this function to detect if a write permission is given before calling copyFile().

Best Regards
Leopold Knipp
Senior Support Specialist

Post Reply
5 posts • Page 1 of 1