Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John Hodgkinson 613 posts 355 karma points
    Mar 06, 2015 @ 22:11
    John Hodgkinson
    0

    URL picker just spinning, generating 500 server error

    just started getting 500 server errors...

    http://mysite.com/umbraco/plugins/uComponents/UrlPicker/UrlPickerService.asmx/MediaNodeUrl

    when I click on the link in debug mode, i get the following message:

    System.InvalidOperationException: Missing parameter: id. at System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection) at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

    any ideas? this is shutting our ability down to edit our site... also, we recently upgraded to Umbraco 6.2.5 - any known issues there? many thanks!

  • John Hodgkinson 613 posts 355 karma points
    Mar 06, 2015 @ 22:31
    John Hodgkinson
    0

    seeing this on another server as well when I try to access the URLPickerService.asmx

    Server Error in '/' Application. Request format is unrecognized for URL unexpectedly ending in '/MediaNodeUrl'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/MediaNodeUrl'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/MediaNodeUrl'.] System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +668425 System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +306 System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +89 System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +516 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209

  • John Hodgkinson 613 posts 355 karma points
    Mar 09, 2015 @ 15:36
    John Hodgkinson
    0

    ok, I rolled back to Umbraco 6.2.4 on one of our dev servers and everything is working again, any idea on what could be breaking this between umbraco 6.2.4 and 6.2.5? many thanks!

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Mar 09, 2015 @ 18:05
    Lee Kelleher
    0

    Hi John,

    I haven't used uComponents UrlPicker with v6.2.5, so I haven't seen this error myself, (sorry). Something does seem a little suspect between the upgrades.

    If you do try the upgrade again and hit the same issue, could you raise it as a bug on our GitHub please?
    https://github.com/uComponents/uComponents/issues

    We can then try to pinpoint whether it is Umbraco core or uComponents or something else.

    Thanks,
    - Lee

  • John Hodgkinson 613 posts 355 karma points
    Mar 09, 2015 @ 18:49
    John Hodgkinson
    0

    Lee - will do. I've submitted a ticket on the umbraco side already. I've tried to update multiple times and run into the same issue each time I've tried.

    http://issues.umbraco.org/issue/U4-6378

  • John Hodgkinson 613 posts 355 karma points
    Mar 09, 2015 @ 18:52
    John Hodgkinson
    0

    Lee - just submitted it on GitHub. Appreciate your help! Many thanks!

    https://github.com/uComponents/uComponents/issues/30

  • Governor Technology 146 posts 551 karma points
    Mar 11, 2015 @ 12:36
    Governor Technology
    0

    Hi guys.

    I'm getting the same error after upgrading from Umbraco 4.11.10 to Umbraco 6.2.5 (reinstalled latest uComponents 6.0.0). Viewing a backend node with an existing Multi Url Picker where media items have been selected, doesn't show these anymore - instead the loading symbol just remains. Looking at the errors, the above exception is thrown for each media item selected across all Url Pickers for that node. So far, the suggestions at http://issues.umbraco.org/issue/U4-6378 do not make any difference. Unfortunately, in my case, downgrading to 6.2.4 is not an option.

    Any further assistance will be appreciated.

    Thanks,

    Rigardt

  • Governor Technology 146 posts 551 karma points
    Mar 11, 2015 @ 16:33
    Governor Technology
    0

    So, looking at the source for uComponents, it seems it is down to the following method: uComponents.DataTypes.UrlPicker.Services.MediaNodeUrl. It extracts the media item XML by ID and then uses XElement.Parse on it, however it seems that in Umbraco 6.2.5, the XML fragment being parsed here has multiple root elements, which causes this method to fail. Here is a sample of my XML:

    <umbracoFile>/media/123456/some.pdf</umbracoFile>
    <umbracoExtension>pdf</umbracoExtension>
    <umbracoBytes>141786</umbracoBytes>
    

    I'm not sure if this fragment used to have a valid root node in 6.2.4, but in my instance, this isn't the case anymore. I'm also not sure if it's still suppose to have a valid root element in 6.2.5 that got lost for some reason during the upgrade.

    I ended up recompiling uComponents.DataTypes.dll with a fix and all seems good now!

    Rigardt

  • John Hodgkinson 613 posts 355 karma points
    Mar 11, 2015 @ 16:59
    John Hodgkinson
    0

    That's awesome. Do you mind posting what changes you made? Many thanks!

  • Governor Technology 146 posts 551 karma points
    Mar 11, 2015 @ 17:45
    Governor Technology
    1

    Sure, here's my amended method:

    public string MediaNodeUrl(int id)
    {
        Authorize();
    
        var media = XElement.Parse(string.Format("<root>{0}</root>", library.GetMedia((int)id, false).Current.InnerXml));
    
        var umbracoFile = media.Descendants(Constants.Umbraco.Media.File);
    
        if (umbracoFile.Any())
        {
            return umbracoFile.First().Value;
        }
        else
        {
            // Cycle through other properties
            foreach (var element in media.Descendants())
            {
                // Check if the property looks like a URL to the media folder
                if (element != null &&
                    !string.IsNullOrEmpty(element.Value) &&
                    element.Value.Contains("/media/"))
                {
                    return element.Value;
                }
            }
        }
    
        return null;
    }
    
  • John Hodgkinson 613 posts 355 karma points
    Mar 11, 2015 @ 17:49
    John Hodgkinson
    0

    Sweet! Many thanks!

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Mar 11, 2015 @ 23:41
    Lee Kelleher
    0

    Thanks for the updates Rigardt.

    I've made a note of it on the uComponents issue tracker: https://github.com/uComponents/uComponents/issues/30#issuecomment-78388201

    I'll try to schedule some time to patch it up and get a patch release out, (I can't promise anything immediate - I'm juggling lots of Umbraco packages at the moment).

    Cheers,
    - Lee

  • John Hodgkinson 613 posts 355 karma points
    Mar 12, 2015 @ 13:37
    John Hodgkinson
    0

    Thx Rigardt and Lee! Much appreciated!

    Lee - is this the correct link for the latest source for uComponents:

    https://github.com/uComponents/uComponents/tree/master/src

  • Scott Leslie 28 posts 143 karma points
    Mar 20, 2015 @ 15:50
    Scott Leslie
    0

    Hi,

    having same problem here with 6.2.5

    Looking at the uComponents source code and the MediaNodeUrl(int id), i cannot get the fix provided by Governor Technology  to compile.

    doesn't like :

    umbracoFile.Any() 

    not sure if i have missed anything?

    Thanks

     

  • John Hodgkinson 613 posts 355 karma points
    Mar 20, 2015 @ 15:52
    John Hodgkinson
    0

    Scott - did you copy over the umbraco 6.2.5 assemblies into the uComponents solution?

  • Governor Technology 146 posts 551 karma points
    Mar 20, 2015 @ 16:03
    Governor Technology
    1

    Hi Scott

    The .Any() won't work unless you have "using System.Linq;" at the top. Can you please confirm this?

    Rigardt

  • Scott Leslie 28 posts 143 karma points
    Mar 20, 2015 @ 16:05
    Scott Leslie
    0

    yip.

    sorry - scanned over the using and saw using System.Xml.Linq; as using System.Linq;

     

    Thanks

    Scott 

  • Scott Leslie 28 posts 143 karma points
    Mar 20, 2015 @ 23:39
    Scott Leslie
    0

    Thanks Rigardt and John - got this workaround working.

  • Daryl Teo 6 posts 28 karma points
    Apr 01, 2015 @ 06:12
    Daryl Teo
    0

    Hi,

    I've also encountered this issue. I applied the fix, but still had issues with the javascript.

    I'm not sure if the other posters also encountered this issue, but the problem was that the web service call was returning JSON and jQuery immediately picked it up and turned it into an object. This caused an issue with responseText.replace (as an object it doesn't have the replace function).

    I fixed this by altering UrlPickerScripts.js. Recompile this together with the changes to UrlPickerService and it should then work.

                    success: function (responseText) {
                    // Strip any <pre> tags and parse the JSON
                    var response = jQuery.parseJSON(responseText.replace(/<(\/)?pre[^>]*>/gi, ""));
    

    Change to

                    success:function (response) {
    

    Regards,

    Daryl Teo

Please Sign in or register to post replies

Write your reply to:

Draft