Copied to clipboard

Flag this post as spam?

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


  • Jesper Buus Thomsen 3 posts 73 karma points
    Aug 30, 2017 @ 20:13
    Jesper Buus Thomsen
    0

    "Domain Name '4' Does not exists" umbraco crashing.

    Umbraco 7.3.4

    Server unpredictivly crashes and needs reboot to function again. Crash can not be forced. Solution consists of Umcraco and Ucommerce, hosted in an Azure enviroment.

    Anyone with an idea?

    Screen dumb after server crash

  • Mads Due 11 posts 72 karma points
    Jun 18, 2018 @ 12:41
    Mads Due
    0

    Hi Jesper

    Can I persuade you to elaborate on when this error occurs and if you have done any customization to the domain service?

    Which version of Ucommerce are you using?

    Regards Mads

  • Jesper Buus Thomsen 3 posts 73 karma points
    Jun 18, 2018 @ 12:53
    Jesper Buus Thomsen
    0

    Our Version is :Umbraco version 7.3.4 assembly: 1.0.5820.25371.

    No customization done to the domain service?

  • Comment author was deleted

    Jun 18, 2018 @ 13:28

    Looks like ucommerce is crashing, did you add a domain with the alias "4"?

  • Mads Due 11 posts 72 karma points
    Jun 19, 2018 @ 08:42
    Mads Due
    0

    Hi Jesper,

    I can see that we have updated our impl of GetUmbracoDomains(...) in Ucommerce 7.7.0 to use Umbraco api's for getting the domains.

    Therefore, I would recommend an update of Ucommerce to fix this.

    However, you can apply below workaround if an upgrade isn't possible: 1. Create a new impl of IDomainService (see below) 2. Register the new impl as a component in the IOC (id="DomainService") https://docs.ucommerce.net/ucommerce/v7.16/extending-ucommerce/register-a-component.html

    Please let me know if you need me to elaborate and how it turns out:)

    Regards Mads

    This is how our UmbracoDomainService looks today:

    public class UmbracoDomainService : IDomainService
    {
        private static IList<umbraco.cms.businesslogic.web.Domain> _umbracoDomains;
        private IEnumerable<umbraco.cms.businesslogic.web.Domain> UmbracoDomains
        {
            get
            {
                if (_umbracoDomains == null)
                    _umbracoDomains = GetUmbracoDomains();
                return _umbracoDomains;
            }
        }
    
        private IList<umbraco.cms.businesslogic.web.Domain> GetUmbracoDomains()
        {
            return umbraco.cms.businesslogic.web.Domain.GetDomains().ToList();
        } 
    
        /// <summary>
        /// Get a list of <see cref="Domain">domains</see> supported by the CMS.
        /// </summary>
        /// <returns></returns>
        public virtual IEnumerable<Domain> GetDomains()
        {
            return UmbracoDomains.Select(CreateDomain);
        }
    
        /// <summary>
        /// Get specific <see cref="Domain"/> by id.
        /// </summary>
        /// <param name="domainId"></param>
        /// <returns></returns>
        public Domain GetDomain(int domainId)
        {
            var domain = GetUmbracoDomainInstance(domainId);
            return CreateDomain(domain);
        }
    
        /// <summary>
        /// Get specific <see cref="Domain"/> by name.
        /// </summary>
        /// <param name="domainName"></param>
        /// <returns></returns>
        public Domain GetDomain(string domainName)
        {
            var domain = GetUmbracoDomainInstance(domainName);
            if (domain == null) return null;
            return CreateDomain(domain);
        }
    
        /// <summary>
        /// Resolves current domain.
        /// </summary>
        /// <returns></returns>
        public virtual Domain GetCurrentDomain()
        {
            var domains = GetDomains()
                    .Where(x => !x.DomainName.Contains('*') && new UriBuilder(x.DomainName).Host == HttpContext.Current.Request.Url.Host)
                    .OrderBy(x => x.DomainName.Length)
                    .ToList();
    
            for (int i = domains.Count - 1; i >= 0; i--)
            {
                var domain = domains[i];
                if (HttpContext.Current.Request.Url.AbsoluteUri.Contains(domain.DomainName))
                    return domain;
            }
    
            return domains.FirstOrDefault();
        }
    
        private Domain CreateDomain(umbraco.cms.businesslogic.web.Domain domain)
        {
            return new Domain(domain.Id.ToString(), domain.Name, new CultureInfo(domain.Language.CultureAlias));
        }
    
        private umbraco.cms.businesslogic.web.Domain GetUmbracoDomainInstance(int id)
        {
            return new umbraco.cms.businesslogic.web.Domain(id);
        }
    
        private umbraco.cms.businesslogic.web.Domain GetUmbracoDomainInstance(string domainName)
        {
            if (!umbraco.cms.businesslogic.web.Domain.Exists(domainName)) return null;
    
            return new umbraco.cms.businesslogic.web.Domain(domainName);
        }
    }
    
  • Nigel Wilson 944 posts 2076 karma points
    Feb 10, 2021 @ 18:42
    Nigel Wilson
    0

    Hi Mads

    Sorry to dredge up an old thread but I have just stumbled across this in trying to resolve an issue I have.

    On my local I have nwn.local (which includes ucommerce instance) and then I also have blog.nwn.local.

    In the header of the site I have a mini basket with a counter of products in the basket. When on the blog.nwn.local sub site the basket doesn't work.

    I have set the hostnames in Umbraco / Content.

    I have set the domain in Ucommerce / Stores.

    However when setting the domain in Ucommerce I get an error of "No product catalog group supporting the url "https://blog.nwn.local:443/" found." When leaving the Ucommerce domain to default, there is no error.

    So I have tried to implement the above domain service, but it hasn't made any difference.

    I have put break points on all the methods in the class file but nothing gets "hit".

    I have added the following config in /umbraco/ucommerce/configuration

    <configuration>
        <components>
        <component id="DomainService"
          service="UCommerce.Content.IDomainService, UCommerce" type="web.Code.Services.UmbracoDomainService, web" />
        </components>
    </configuration>
    

    Is there anything you can see / suggest please ?

    Thanks

    Nigel

  • Jesper Buus Thomsen 3 posts 73 karma points
    Jun 27, 2018 @ 06:04
    Jesper Buus Thomsen
    0

    Seems that it solved, thx a lot.

Please Sign in or register to post replies

Write your reply to:

Draft