TFS2013 Fails to Deserialize Parameters containing "$/" - tfs

I'm using the TFS 2013 XAML Build Process Template and have some parameters that contain TFS paths (i.e. start with $/) and the build immediately fails when deserializing the parameters.
The only workaround I have is to use $\/ but this gets pushed through as it is literally, breaking things that expect $/. Is there any way I can escape the strings properly?
e.g.
Post-build script arguments: -Path1 "$/MyProject/MySolution.sln" -Path2 $/MyProject/NuGet"
MSBuild arguments: /p:PackageOutputDir="$/MyProject/NuGet"
This is causing the following type of exception when I try to run a build:
Exception Message: TF401070: Could not deserialize the JSON string provided. Details:
After parsing a value an unexpected character was encountered: \. Path 'PostActionScriptArguments', line 1, position 449. (type BuildParameterSerializationException)
Exception Stack Trace: at Microsoft.TeamFoundation.Build.Common.BuildParameter.set_Json(String value)
Inner Exception Details:
Exception Message: After parsing a value an unexpected character was encountered: \. Path 'PostActionScriptArguments', line 1, position 449. (type JsonReaderException)
Exception Stack Trace: at Newtonsoft.Json.JsonTextReader.ParsePostValue()

Related

How can I include code in a scaffolding view template in Grails 5?

I need to import one of my classes in one of my scaffolding views, this used to work in Grails 2 but now appears broken under 5.
I've tried both the GSP and JSP way of importing and both result with the same exception.
The error is as follows..
Message
Request processing failed; nested exception is groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript3.groovy: 3: Unexpected input: '# page import' # line 3, column 13. """; # page import="tst.Customer" ; ^ 1 error
Caused by
Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: GStringTemplateScript3.groovy: 3: Unexpected input: '# page import' # line 3, column 13. """; # page import="tst.Customer" ; ^ 1 error
Thank you,

How to identify exactly where exception occurred in Jenkins pipeline?

In Jenkins pipeline build, sometimes I've seen null pointer or other exceptions like -
java.lang.NullPointerException: Cannot invoke method trim() on null object
Generally if we run Java program through IDE or command line, if an exception occurs we see at which line number the exception has occurred.
But with Jenkins build output console, it does not show the line number where the exception has occurred.
In this case, based on method name ie trim() from log, I check wherever trim() method is used. But as I've used it at multiple places in same method, it becomes difficult to identify exactly where error has occurred.
Another way is to add echo statements and re-run build and see where it gives this exception but this is time consuming.
Is there any better way/plugin using which I can identify at which line of pipeline code exception has occurred?
I don't really know if it's possible to show the exact line number, but you can wrap your code in try-catch statements and then show the exception info in the catch, like so:
try {
// line with trim()
catch (ex) {
println "Exception while trimming: $ex"
}

Visual Studio 2017 Error initializing VroomJs.JsEngine

My project uses Reactjs, and I use Visual Studio 2017. Recently I did an software update on VS 2017, but no code/config changes.
However, when I start my project locally in debug mode, I encountered below error:
No JavaScript engines were registered, falling back to a default config! It is recommended that you configure JavaScriptEngineSwitcher in your app. See https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines for more information.
Error initialising JavaScriptEngineSwitcher.V8.V8JsEngineFactory: JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of V8JsEngine error has occurred.
See more details:
Cannot load V8 interface assembly. Load failure information for v8-ia32.dll:
C:\Users\user1\AppData\Local\Temp\Temporary ASP.NET Files\vs\77655ce5\ca0bb6d0\assembly\dl3\300b733a\003cadac_c3f4d201\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\bin\v8-ia32.dll: The specified module could not be found ---> System.TypeLoadException: Cannot load V8 interface assembly. Load failure information for v8-ia32.dll:
C:\Users\user1\AppData\Local\Temp\Temporary ASP.NET Files\vs\77655ce5\ca0bb6d0\assembly\dl3\300b733a\003cadac_c3f4d201\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\bin\v8-ia32.dll: The specified module could not be found
at Microsoft.ClearScript.V8.V8Proxy.LoadNativeLibrary()
at Microsoft.ClearScript.V8.V8Proxy.LoadAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type)
at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
at Microsoft.ClearScript.V8.V8IsolateProxy.Create(String name, V8RuntimeConstraints constraints, Boolean enableDebugging, Int32 debugPort)
at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
--- End of inner exception stack trace ---
at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
Error initialising React.VroomJsEngine+Factory: JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of VroomJs JavaScript engine error has occurred.
See more details:
The type initializer for 'VroomJs.JsEngine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'VroomJs.JsEngine' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'VroomJsNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at VroomJs.JsEngine.js_set_object_marshal_type(JsObjectMarshalType objectMarshalType)
at VroomJs.JsEngine..cctor()
--- End of inner exception stack trace ---
at VroomJs.JsEngine..ctor(Int32 maxYoungSpace, Int32 maxOldSpace)
at React.VroomJsEngine.<>c.<.cctor>b__23_0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at React.VroomJsEngine.get_Engine()
at React.VroomJsEngine..ctor()
--- End of inner exception stack trace ---
at React.VroomJsEngine..ctor()
at React.VroomJsEngine.Factory.CreateEngine()
at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
This error does not block me from running and testing the code.
Like I said, all I did recently was to update the VS 2017 software...I tried to do a wild search in the project for 'v8-ia32' but nothing found.
To fix these errors I did the following:
Make sure you install the JavaScriptEngineSwitcher.V8, JavaScriptEngineSwitcher.V8.Native.win-x86 and JavaScriptEngineSwitcher.V8.Native.win-x64.
(I didn't install JavaScriptEngineSwitcher.V8.Native.win-x86)
According to https://reactjs.net/getting-started/aspnet.html
edit the ReactConfig.cs, basically, I just added this
JsEngineSwitcher.Current.DefaultEngineName = V8JsEngine.EngineName;
JsEngineSwitcher.Current.EngineFactories.AddV8();
Rebuild the project.

Read a list from stream using Yap-Prolog

I want to run a (python3) process from my (yap) prolog script and read its output formatted as a list of integers, e.g. [1,2,3,4,5,6].
This is what I do:
process_create(path(python3),
['my_script.py', MyParam],
[stdout(pipe(Out))]),
read(Out, OutputList),
close(Out).
However, it fails at read/2 predicate with the error:
PL_unify_term: PL_int64 not supported
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
I am sure that I can run the process correctly because with [stdout(std)] parameter given to process_create the program outputs [1,2,3,4,5,6] as expected.
Weird thing is that when I change the process to output some constant term (as constant_term) it still gives the same PL_int64 error. Appending a dot to the process' output ([1,2,3,4,5,6].) doesn't solve the error. Using read_term/3 gives the same error. read_string/3 is undefined in YAP-Prolog.
How can I solve this problem?
After asking at the yap-users mailing list I got the solution.
Re-compiled YAP Prolog 6.2.2 with libGMP option and now it works. It may also occur in 32-bit YAP.

Core Data Relationship Mappings: Double Quotes in Value Expression are automatically turned into single quotes

After generating a Mapping Model for a Core Data Migration, all Value Expressions for the relationship mapping are generated correctly except 1 Value Expression, where the arguments have single quotes (') instead of double quotes ("). This results in a parsing error.
This is what I would expect:
FUNCTION($manager ,"destinationInstancesForEntityMappingNamed:sourceInstances:" , "MatchToMatch" , $source.matches)
But this is how the function expression is generated:
FUNCTION($manager ,'destinationInstancesForEntityMappingNamed:sourceInstances:' , 'MatchToMatch' , $source.matches)
A specific Value Expression is always generated with single quotes
When I change the "Source Fetch" option in the right sidebar to "Use Custom(...)" and enter the expression manually, all double quotes are turned back into single quotes.
When I change the Value Expression directly in the Mapping Editor table, I get the following error message:
Unable to parse the format string "FUNCTION($manager >,"destinationInstancesForEntityMappingNamed:sourceInstances:" , >"MatchToMatch" , $source.matches) == 1"
When I build and run a migration, I get the following error message:
2016-01-27 10:30:33.875 mapc[1431:352140] *** Terminating app due to >uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse >the format string "FUNCTION($manager >,'destinationInstancesForEntityMappingNamed:sourceInstances:' , >'MatchToMatch' , $source.matches) == 1"'
Can someone explain, what is happening and how I can come around this issue?
The problem here is that matches is a reserved keyword.
Reserved keywords:
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html
Check the note described here:
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmMappingOverview.html
You need to remove broken relationship
Add new one with empty "Value Expression"
Look here

Resources