Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Assets- Illegal charecters in path- stuck in loop



  • I tried to add a PS Script as an asset, and it gave me an error about illegal characters in the path. OK, I get that, but how come it is locked in a loop and every time I try to go to the assets tab I keep getting this, even on computers I haven't tried to add anything to?

    Product: Otter
    Version: 2.0.5


  • inedo-engineer

    Hello Jonathan,

    If the name of the script includes ", <, >, or |, that might be causing this problem.

    I'll fix the code to handle this, but in the meantime, you can delete the raft item through the database:

    EXECUTE [Rafts_DeleteRaftItem]
        /* default raft */ 1,
        /* script */ 4,
        /* the filename that includes invalid characters */ 'badname.ps1',
        /* hard delete (don't just deactivate) */ 'Y'
    


  • Hello Ben, thanks for the reply. I ran the sql query against my otter db, and changed the ps1 file to the script I was trying to change. I executed the query, and it said it ran correctly. I even restarted the service, no dice. I am not able to move forward with my project until I am able to add PS scripts. I appreciate the help!

    Here is the error log:

    Logged:

    2/22/2018 11:28:34 AM

    Level:

    Error

    Category:

    HTTP

    Message:

    An error occurred in the web application: Illegal characters in path.

    Details:

    URL: http://localhost:8626/assets
    Referrer: http://localhost:8626/servers
    User: Express User
    User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Stack trace: at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
    at System.IO.Path.GetFileName(String path)
    at System.IO.Path.GetFileNameWithoutExtension(String path)
    at Inedo.Otter.WebApplication.Pages.Assets.PowerShellScriptsOverviewPage.<>c__DisplayClass4_0.<CreateBodyContent>b__1(RaftItem p)
    at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at Inedo.Web.Controls.Element.<GetControlsFromArgument>d__41.MoveNext() at Inedo.Web.Controls.Element..ctor(String elementType, Object[] content) at Inedo.Otter.WebApplication.Pages.Assets.PowerShellScriptsOverviewPage.CreateBodyContent(Int32 raftId, IList1 items)
    at Inedo.Otter.WebApplication.Pages.Administration.Rafts.RaftContentsPageBase`1.<CreateChildControlsAsync>d__20.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Inedo.Otter.WebApplication.Pages.OtterSimplePageBase.<InitializeAsync>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Inedo.Web.PageFree.SimplePageBase.<ProcessRequestAsync>d__46.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
    at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)


  • inedo-engineer

    If you run this:

    EXECUTE [Rafts_GetRaftItems]
    		@Raft_Id = 1,
    		@RaftItemType_Code = 4,
    		@RaftItem_Name = NULL
    

    the last item listed is probably the one that's causing this problem (because the overview page stopped working when it was added).

    OT-210 will fix this, but deleting the specific script that's causing the problem might be difficult through the exposed API if the name contains control characters. Instead, accessing the table directly might be easier in this case:

    DELETE FROM [RaftItems]
     WHERE [RaftItem_Id] = 12345
    -- obviously, 12345 would be replaced with the ID obtained in the result of the previous query.
    


  • Thank you, that did the trick. I was using the copy path from the Ribbon in Explorer, and it already adds quotes to it. I saw in the db query that it added a ".ps1" to the end of the file name, thus creating a hiccup.

    I also noticed it had the path of where I stored the PoSh script. What is the value in having the path where I uploaded it contained there? Does it truly not add the script as an object and relies on it's path in the OS where it is uploaded from? Surely this can't be true.

    Any videos or recommendations for getting started with DevOps using Inedo products? We are all infrastructure people who are learning code, and are not familiar with code repositories, etc. We want to continue using code to configure our infrastructure, but would like something that all works together. Thanks!



  • I'm not sure I totally understand what you mean by "had the path of where I stored the PoSh script"? Basically, when you create an asset in Otter, it is stored in a Raft, which is a sort of abstract file system. So, it's basically just a file (script-name.ps1) stored in this raft.

    We are working on building out our training videos (sadly, they take quite a while), but we'd love to learn what your overall goals are, and how we can build good content to help you reach those goals. In a lot of organizations, one of the most important things is "showing the value/success" of automation, infrastructure as code, etc. So we want to help with that too.

    Anyways, it's obvious quite a "big topic", so your best would be to get in touch with us, so we can work together directly.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation