Archive for January, 2015

Azure web job aborted due to no output

My long-running (but fun-loving) web job because un-loving when it failed, and I saw this error in the log:

[01/24/2015 13:44:48 > 0298bf: SYS INFO] Status changed to Initializing
[01/24/2015 13:44:48 > 0298bf: SYS INFO] Run script ‘ScottsProgram.AzureWebJob.exe’ with script host – ‘WindowsScriptHost’
[01/24/2015 13:44:48 > 0298bf: SYS INFO] Status changed to Running
[01/24/2015 13:48:49 > 0298bf: ERR ] Command ‘cmd /c ScottsProgram.AzureWebJob …’ aborted due to no output and CPU activity for 121 seconds.  You may increase SCM_COMMAND_IDLE_TIMEOUT setting to solve the issue.
cmd /c ScottsProgram.AzureWebJob.exe
[01/24/2015 13:48:49 > 0298bf: SYS INFO] Status changed to Failed

So I did my due diligence (I spent a lot of time in large corporate environments in the not so distant past) and found that setting the SCM_COMMAND_IDLE_TIMEOUT variable in the “app settings” section of my Azure web site was the way to go. So I did that and… it did nothing. Same error.

So I did further due diligence and found another suggestion to use the WEBJOBS_IDLE_TIMEOUT app setting. I set that one to an acceptably high value (3600 is a great number), and this one worked, and my web job became loving again.



TypeInitializationException using Zoom.Net.YazSharp.Connection object

I have done work with the YazSharp.dll, which allows you, through .NET, to connect to servers using the Z39.50 protocol. While debugging, I was seeing an exception when I initialized my Zoom Connection object:

Dim conn As New Zoom.Net.YazSharp.Connection(server, port)

 This error was throwing a TypeInitializationException:

 System.TypeInitializationException: The type initializer for ‘Zoom.Net.YazSharp.Connection’ threw an exception. —> System.DllNotFoundException: Unable to load DLL ‘yaz’: The specified module could not be found

 The solution to this is not only add references to the Zoom.Net.dll and Zoom.Net.YazSharp.dll files, but to add all the other relevant files from the Release folder into the bin directory of your project. In my case, I had forgotten to put the Zoom.Net.Factory.config file in the folder. Once I had put that file in along with all the *.dll files, it works. Jai himself mentions that in the comment of his blog post, but I thought I would reinforce that this will solve the issue.

Leave a comment

Using a VARCHAR(MAX) parameter in .NET

So you have a stored procedure with a parameter as a VARCHAR(MAX):

CREATE PROCEDURE [dbo].[GetAwesomeDude]
@CustomerName VARCHAR(MAX)

SELECT * FROM CoolAwesomeTable
WHERE ID = @CustomerName

How do you designate this in C#? You use “-1” as the parameter size:

SqlParameter param = new SqlParameter(“@CustomerName”, SqlDbType.VarChar, -1);
param.Value = poly.Points;

Not too difficult, but not too intuitive either.

Leave a comment