Invalid URI error

Topics: User Forum
May 19, 2010 at 5:58 PM

When I run this command:

C:\ParkerSSIS\DTLoggedExec\DTLoggedExec.exe /Server:"AAG0J6XD07" /SQL:"MSS\_Import File MKPRICEP" /Set:"\package.variables[User::varDiv].Value;ATK" /Set:"\package.variables[User::varJobNameBuilt].Value;!Auto_ATK_MKPRICEP" /Set:"\package.variables[User::varConfigServer].Value;AAG0J6XD07" /LE:E,I,T,W /LP:DTLoggedExec.LogProviders.CSVLogProvider /LPA:"FILE=C:\ParkerSSIS\Log\!Auto_ATK_MKPRICEP_{date}_{time}.dtsCSVLog"

I get this output/error:

DTLoggedExec Copyright c Davide Mauri 2006-2010 v.1.0.0.1
Some Rights Reserved. Licensed under the Creative Commons Attribution-NonCommerc
ial-NoDerivs 2.5 Italy License.
More info here: http://dtloggedexec.davidemauri.it

Target platform: 64bit

Logged Events: Information, TaskFailed, Warning, Error
Requested log provider: DTLoggedExec.LogProviders.CSVLogProvider


Unhandled Exception: System.UriFormatException: Invalid URI: The hostname could
not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at DTLoggedExec.Program.Main(String[] args)

 

Is hostname referring to the /LPA?  I've tried even the simplest path.

May 19, 2010 at 6:04 PM

UPDATE:

I decided to try this command without the /LP and /LPA parms, still get the same error with the console?

C:\ParkerSSIS\DTLoggedExec>C:\ParkerSSIS\DTLoggedExec\DTLoggedExec.exe /Server:"
AAG0J6XD07" /SQL:"MSS\_Import File MKPRICEP" /Set:"\package.variables[User::varD
iv].Value;ATK" /Set:"\package.variables[User::varJobNameBuilt].Value;!Auto_ATK_M
KPRICEP" /Set:"\package.variables[User::varConfigServer].Value;AAG0J6XD07" /LE:E
,I,T,W
DTLoggedExec Copyright c Davide Mauri 2006-2010 v.1.0.0.1
Some Rights Reserved. Licensed under the Creative Commons Attribution-NonCommerc
ial-NoDerivs 2.5 Italy License.
More info here: http://dtloggedexec.davidemauri.it

Target platform: 64bit

Logged Events: Information, TaskFailed, Warning, Error
Requested log provider: DTLoggedExec.LogProviders.ConsoleLogProvider


Unhandled Exception: System.UriFormatException: Invalid URI: The hostname could
not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at DTLoggedExec.Program.Main(String[] args)

Coordinator
May 22, 2010 at 8:46 AM

Thanks a lot for the feedback. I'm going to figure out why this happen right now. I'll update a fix as soon as possible.

Jun 1, 2010 at 3:58 PM
 

Any progress on this?  I'd rather not have to debug it myself, but I've got some pressure to get this working.  This is on Win 2008 R2 server running SQL 2008 current patches.

Coordinator
Jun 2, 2010 at 1:04 PM

Hi dwainew

I think I have found the problem, but 'till next week I cannot compile the new version.

If you cannot wait, commenting the following lines of code

if (appArgs.FILE != null) _packageUri = new Uri("file://" + appArgs.FILE);
if (appArgs.DTS != null) _packageUri = new Uri("dts://" + appArgs.DTS);
if (appArgs.SQL != null) _packageUri = new Uri("sql://" + appArgs.SQL);

and the following

_packageUri = new ...;

in the try...catch section just after the 

Console.WriteLine("Starting to load Package...");

line, in Program.cs should fix the problem.

Unfortunately I cannot test it right now, as said before, I want have access to my development machine before next week.

Hope this helps anyway.

Davide

Jun 9, 2010 at 1:19 AM

Thanks!  I'll let you know how it goes when I get a chance to try it.

 

Jun 10, 2010 at 1:43 AM

A few observations...

your changes didn't work for me.  _packageUri is used during CreateCustomEventHandler

...

                logProvider.SetPackageInfo(_packageUri);

...

 

I tracked why my parms are bombing on:

                if (appArgs.SQL != null) _packageUri = new Uri("sql://" + appArgs.SQL);

.... uri doesn't like my backslashes, changing the package path (/SQL:"\folder\folder\package") to have "/"s instead of "\"s fixed that (but this is another conflict with DTEXEC functionality).

continuing, during logProvider.Configure(logProviderConfigurationString);

my filepath bombs on line

            if (Path.GetExtension(filePath) != EXTENSION) filePath += EXTENSION;

because it has a \r\n.  Not sure how that gets into the arg, but in my sql agent job step I do put a CrLf AFTER the command line for read/copy-ability

          "C:\\ParkerSSIS\\Logs\\!Auto_ATK_MKPRICEP_{date}_{time}.dtsCSVLog\r\n"

trimming filePath before this line clears that up....

            filePath = filePath.Trim();

But now I'm receiving an exception at

                Application app = new Application();

Exception Details....

Microsoft.SqlServer.Dts.Runtime.DtsPipelineException was unhandled
  Message="Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154."
  Source="Microsoft.SqlServer.ManagedDTS"
  ErrorCode=-2147221164
  StackTrace:
       at Microsoft.SqlServer.Dts.Runtime.Application..ctor()
       at DTLoggedExec.Program.Main(String[] args) in C:\Source2K8\Enterprise Reporting\Tools\DTLoggedExec.root\DTLoggedExec\Program.cs:line 74
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       Message="Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154."
       Source="Microsoft.SqlServer.ManagedDTS"
       ErrorCode=-2147221164
       StackTrace:
            at Microsoft.SqlServer.Dts.Runtime.Application..ctor()
       InnerException:

Which I know is wrapper/dependency related....  but no time to go further...

so, I suggest trimming the FILE= arg and changing \ to / in the /SQL arg, but still don't have it running...

 

 

Jun 10, 2010 at 1:53 AM

got it working....

Changed all references to the DTS assemblies to "specific version" = false

I had 10.0

your proj was 9.x

rebuilt and bingo.

 

Jun 10, 2010 at 2:05 AM

In summary, I got my version working with the dependency changes above and adding the following lines...

 

                appArgs.SQL = appArgs.SQL.Replace("\\","/");
                appArgs.LogProviderArguments = appArgs.LogProviderArguments.Trim();

 

right before

                if (appArgs.FILE != null) _packageUri = new Uri("file://" + appArgs.FILE);

thanks, and hope that helps.

Coordinator
Jun 11, 2010 at 3:08 PM

Hi dwainew

I've just released version 1.0.0.2 that should fix all problems related to URIs and also add support for {filename} token in DataFlow Profiling and CSV Log Providers. In this way creating a log or a dataflow profile that has the same name of the package that generated it, will be easier:

/LPA:"FILE=C:\Log\{filename}_{date}_{time}"
/PDFN:"C:\Profile\{filename}_{date}_{time}"