false error message: scripts folder contains parser errors
vincentj
Posts: 47
Hi, I've been seeing errors reported by our build system that I haven't been able to figure out. Here's a sample error message:
The hard part is that I can't reliably reproduce the error. If I run the exact same build a second time, it will work. The error doesn't always occur on the same file, though it's always on a user file. These user files haven't changed at all since we added them to Subversion. The error doesn't always occur at the same step in the build process, and it doesn't always happen on the same database. Usually the error comes from Data Compare, but sometimes it comes from SQL Compare. I've never been able to reproduce the error by running the same comparison through a command prompt. The error doesn't occur with any of our other build jobs.
The only thing that seems reliable is that it appears to happen every other time I run this particular build. I've examined the scripts following an error, and ran the comparison manually, but can't seem to figure out what causes it.
I'm totally baffled by this. Any suggestions?
Error: If statement in file D:\build\Database\Security\Users\BUILTIN_Administrators.sql at line 1 considered as true Error: The scripts folder at D:\build\Database contains parser errors. Please review the scripts. You can ignore the parser errors by using the/ignoreparsererrors switch.
The hard part is that I can't reliably reproduce the error. If I run the exact same build a second time, it will work. The error doesn't always occur on the same file, though it's always on a user file. These user files haven't changed at all since we added them to Subversion. The error doesn't always occur at the same step in the build process, and it doesn't always happen on the same database. Usually the error comes from Data Compare, but sometimes it comes from SQL Compare. I've never been able to reproduce the error by running the same comparison through a command prompt. The error doesn't occur with any of our other build jobs.
The only thing that seems reliable is that it appears to happen every other time I run this particular build. I've examined the scripts following an error, and ran the comparison manually, but can't seem to figure out what causes it.
I'm totally baffled by this. Any suggestions?
Comments
So, this leads me to a couple of thoughts- either the file is changing between the problem occurring and the subsequent run where it succeeds, or some other problem is occurring with the file that ends up being output as a parsing error.
For the former - are any developers running procedures that would be potentially updating the files during the run of Compare? For the latter, i'd suggest making sure that any antivirus scanners you have are excluding the folders where the scripts are located. We've seen this occasionally cause trouble with other applications (although I'm not sure it's popped out as a parser error) but it's worth checking.
Failing that, we'll have to see if we can get any more diagnostics...
Redgate Software
I had our IT team add the scripts folder to the antivirus exception list, but unfortunately, that didn't solve the problem either.
My earlier statement about this failing every other time is also no longer true; we had three consecutive successful runs last week, and two consecutive failures yesterday.
Please let me know if you have any other suggestions, or if there is more information I can gather to help. Thanks.
Ideally, we'd need the commandline to be able to output more detailed logging information that may help. Right now, it doesn't do that (although we do have a feature request, SC-4336 to look at this).
The only other thing I could think of, if you're performing a relatively simple sync, would be to knock up a quick app using our SDK to do it - in theory, when the exception occurs, you could then grab the full exception tree + stack trace which /may/ produce more information (although I won't guarantee it...)
Redgate Software
Unfortunately, I've been moved to a new project so I don't have time to write an app using the SDK. If there is a simpler option or workaround then I could probably get some time to look into it.
One thought I had: we don't need to sync our users, they don't change frequently. Would it be possible to remove them from source control entirely? I'm concerned that it might cause dependency issues, but if there's a safe way to remove those scripts then I'm willing to try it.
You can then exclude users by unticking them - hopefully this may help?
Redgate Software
(These errors are coming from SQL Compare/SQL Data Compare, not SQL Source Control, by the way. I double-checked to make sure they're both at the latest version, just to be sure.)
Would you be able to send a SQL Compare snapshot, or a backup of the database we can look at? If we could set up a similar project we could see if we find the same issue.
If you are able to provide the schema, could you contact support@red-gate.com and we'll open a ticket.
Regards,
Chris Auckland
I'm getting this too - also random.
Thanks
Joe
I talked to my manager, and we're not comfortable sending a database snapshot, sorry. Is there anything else we can try from here?
If found that the role has a impact on this using db_owner worked for me.