Invalid URI: The hostname could not be parsed.

charles's Avatar

charles

30 Sep, 2013 01:22 AM

I'm getting a "hostname could not be parsed" error when trying to open a newly created repository. This is a new installation, no errors during setup. I have created a new project and repository.

I'm accessing my site internally, via http://servername:8050. In Settings > General, I have the Site URL as http://servername:8050

Suggestions where I went wrong?

  1. Support Staff 1 Posted by Anton Gogolev on 30 Sep, 2013 03:23 AM

    Anton Gogolev's Avatar

    Charles,

    Could you provide a stacktrace for this error (or all the text on a yellowish error page)?

    Also, what are the names/slugs of your project and repository?

    On 30.09.2013, at 5:22, "charles" <[email blocked]> wrote:

  2. 2 Posted by charles on 01 Oct, 2013 01:09 AM

    charles's Avatar

    Project Name: Test Project
    Project Slug: testproject
    Repository Name: MyTest

    Same error using an imported (copied) repository named SC Test.

    URLs:
    http://servername:8050/projects/testproject/repositories/mytest/source/files
    http://servername:8050/projects/testproject/repositories/sc%20test/source/files

    If you need to know my server name, let me know. I'd prefer to send that
    privately.

    Thanks for your quick reply. I'm excited about HgLab, having suffered
    through installing Mercurial to work in IIS.

    Stack Trace:

    [UriFormatException: Invalid URI: The hostname could not be parsed.]
       System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind
    uriKind) +8917178
       System.UriBuilder.get_Uri() +80
       HgLab.Core.Framework.Web.DynamicRouteGenerator.GetRouteInternal(String
    name, String[] argNames, Object[] argValues) in
    c:\Projects\hglab\src\HgLab.Core\Framework\Web\DynamicRouteGenerator.cs:78
       HgLab.Core.Framework.Web.DynamicRouteGenerator.GetRoute(String
    name, String[] argNames, Object[] argValues) in
    c:\Projects\hglab\src\HgLab.Core\Framework\Web\DynamicRouteGenerator.cs:44
       HgLab.Core.Framework.Web.DynamicRouteGenerator.TryInvokeMember(InvokeMemberBinder
    binder, Object[] args, Object& result) in
    c:\Projects\hglab\src\HgLab.Core\Framework\Web\DynamicRouteGenerator.cs:38
       CallSite.Target(Closure , CallSite , Object , String , String , String ) +303
       System.Dynamic.UpdateDelegates.UpdateAndExecute4(CallSite site, T0
    arg0, T1 arg1, T2 arg2, T3 arg3) +1097
       ASP._Page_Areas_Project_Views_Repository__Toolbar_cshtml.Execute()
    in c:\Projects\hglab\src\HgLab\Areas\Project\Views\Repository\_Toolbar.cshtml:10
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext
    pageContext, TextWriter writer, WebPageRenderingBase startPage) +173
       System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper
    htmlHelper, String partialViewName, Object model) +116
       ASP._Page_Areas_Project_Views_Repository_Files_cshtml.<Execute>b__e()
    in c:\Projects\hglab\src\HgLab\Areas\Project\Views\Repository\Files.cshtml:15
       System.Web.WebPages.<>c__DisplayClassb.<RenderSection>b__9(TextWriter
    tw) +289
       System.Web.WebPages.WebPageBase.Write(HelperResult result) +89
       ASP._Page_Areas_Project_Views_Shared__Layout_cshtml.Execute() in
    c:\Projects\hglab\src\HgLab\Areas\Project\Views\Shared\_Layout.cshtml:90
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext
    pageContext, TextWriter writer, WebPageRenderingBase startPage) +173
       System.Web.WebPages.WebPageBase.Write(HelperResult result) +89
       System.Web.WebPages.WebPageBase.RenderSurrounding(String
    partialViewName, Action`1 body) +234
       System.Web.WebPages.WebPageBase.PopContext() +234
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter
    filter, ResultExecutingContext preContext, Func`1 continuation)
    +727120
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
    controllerContext, IList`1 filters, ActionResult actionResult) +265
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
    controllerContext, String actionName) +727076
       System.Web.Mvc.Controller.ExecuteCore() +159
       System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +334
       HgLab.Core.Framework.Web.HgLabControllerBase.Execute(RequestContext
    requestContext) in
    c:\Projects\hglab\src\HgLab.Core\Framework\Web\HgLabControllerBase.cs:69
       System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
       System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +15
       System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +52
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    Boolean& completedSynchronously) +288

  3. 3 Posted by charles on 01 Oct, 2013 01:24 AM

    charles's Avatar

    I tried setting HgLab to a new, empty repository folder and got the error below.

    When I first set up the site, I chose a folder that had my existing repositories in it. When I saved, I was prompted to upgrade (though the version numbers were the same). In that original folder, the structure ended up like this:
    repo
    |_data
      |_repositories
        |_master
          |_testproject
             |_MyTest
             |_SC Test

    The new folder failed to update with a permissions error. I think I fixed the permissions, but keep getting prompted to upgrade. I can't even log off.

    HgLab.Core.Framework.Servicing.ServicingException: Could not perform Upgrade from version 0.3.10.0 to version 0.3.10.0 ---> HgLab.Core.Framework.Servicing.ServicingException: Could not execute TransactionalTask for running version 0.3.10.0 and target version 0.3.10.0 ---> HgLab.Core.Framework.Servicing.ServicingException: Could not execute HomeDirectoryVersionRegistrationTask for running version 0.3.10.0 and target version 0.3.10.0 ---> System.UnauthorizedAccessException: Access to the path 'D:\ServerFolders\Business\hglab\.hglab.version' is denied.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
       at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
       at HgLab.Core.Framework.Servicing.Impl.HomeDirectoryVersionRegistrationTask.InternalExecute(Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Impl\HomeDirectoryVersionRegistrationTask.cs:line 18
       at HgLab.Core.Framework.Servicing.Task.Execute(Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Task.cs:line 21
       --- End of inner exception stack trace ---
       at HgLab.Core.Framework.Servicing.Task.Execute(Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Task.cs:line 30
       at HgLab.Core.Framework.Servicing.Impl.TransactionalTask.InternalExecute(Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Impl\TransactionalTask.cs:line 20
       at HgLab.Core.Framework.Servicing.Task.Execute(Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Task.cs:line 21
       --- End of inner exception stack trace ---
       at HgLab.Core.Framework.Servicing.Task.Execute(Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Task.cs:line 30
       at HgLab.Core.Framework.Servicing.Impl.ServicingManagerService.ExecuteTaskSequence(IEnumerable`1 taskSequence, Version runningVersion, Version targetVersion) in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Impl\ServicingManagerService.cs:line 64
       at HgLab.Core.Framework.Servicing.Impl.ServicingManagerService.PerformUpgrade() in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Impl\ServicingManagerService.cs:line 111
       --- End of inner exception stack trace ---
       at HgLab.Core.Framework.Servicing.Impl.ServicingManagerService.PerformUpgrade() in c:\Projects\hglab\src\HgLab.Core\Framework\Servicing\Impl\ServicingManagerService.cs:line 120
       at HgLab.Areas.Dashboard.Controllers.UpgradeController.Upgrade(UpgradeModel model) in c:\Projects\hglab\src\HgLab\Areas\Dashboard\Controllers\UpgradeController.cs:line 42

  4. Support Staff 4 Posted by Anton Gogolev on 01 Oct, 2013 09:29 AM

    Anton Gogolev's Avatar

    Charles,

    What is the login you're using to sign in to HgLab?

    As for "Upgrading from 0.3.10 to 0.3.10" - this is "by design", albeit not particularly friendly "design". You can try running these commands in a Privileged Command Prompt:

    icacls {hglab-home-directory} /t /remove:g iis_iusrs
    icacls {hglab-home-directory} /grant iis_iusrs:(OI)(CI)(F)
    

    and then click "Upgrade" and wait for HgLab to complete. If it doesn't complete in a reasonable time, create a file named .hglab.version and containing 0.3.10 in your {hglab-home-directory}.

  5. 5 Posted by charles on 02 Oct, 2013 01:44 AM

    charles's Avatar

    >What is the login...
    I'm using my email address as my login.

    Running the icals commands took care of the permissions issue, and the site "upgraded" quickly.

    To test with the new, empty repository folder, I deleted the existing repository/project records in the database.

    Given your question, I also did some testing. Apparently, if Login is an email address, the error occurs. (Or maybe, if Login is same as email.) If login isn't an email, I can log in and view repositories just fine.

    A few initial thoughts, besides the bug(?) of the login.

    1. The documentation isn't exactly accurate when it comes to the folder structure.
    2. Adding existing repositories isn't as easy as copying the folder. It also has to be added via Add Repository.
    3. I can change the home directory, but there's not synchronization with the database.

    The sync issue is probably the biggest. It's going to be hard to make that work unless the site:
    1. Joins home-directory to project or repository.
    2. Has a "resync" feature or utility that looks for changes between the database and the folders.

    I wonder if maintaining project/repository data is needed? The regular Mercurial server can be configured to allow a nested folder structure, which is something I was using. Would you be able to dynamically read the folders, but still maintain your other features (security, pull requests, etc.)?

    As much as I like the site, it may not meet my needs. If I have the time, I may pull and look at your source and see whether I have any useful contribution to make.

    Critique aside, I love the work you're doing. Mercurial in IIS just shouldn't be as hard as it is, and you're making it better.

  6. Support Staff 6 Posted by Anton Gogolev on 02 Oct, 2013 05:35 AM

    Anton Gogolev's Avatar

    Charles,

    There's a bug in 0.3.10 when using an email address as your login triggers an error on certain pages. That one is fixed in a newer version which is long due to be released.

    As for the home directory, that's a tough one (well, except documentation, which is something I've been neglecting for a while). It is generally not encouraged to tinker with directly, since it's supposed to be managed by HgLab itself. True, adding existing repositories can be a bit cumbersome, but streamlining this process is on my todo list. The "official" way is to add an empty repository via web interface and then push to it.

    Having a "Resync Repositories" feature (automatic or manual) is nice, but it would imply encouraging direct access to Home Directory. That's bothersome since there will be a lot more stuff stored there (like Mercurial-backed wikis, forks, attachment blobs, etc) and there's a non-zero chance of screwing things up in the process.

    Thanks for offering contributions, but HgLab is not exactly open-source (HgSharp is) and I'm planning on building a business around it.

    Oh, and thanks for the kind words!

    On 02.10.2013, at 5:44, "charles" <[email blocked]> wrote:

  7. 7 Posted by charles on 02 Oct, 2013 12:58 PM

    charles's Avatar

    I'll look forward to the next version. I'm definitely not finished
    evaluating HgLab. Best wishes on your business.

    Regarding changing home directories, from an installer/admin point of view
    it would help to get a warning or other help that says something like,
    "Changing your home directory is intended for situations where you're
    moving your repositories...."

    Also, while "auto sync" doesn't sound like a good fit, you could have a
    feature for new installations where the site reads a copied repository
    folder and creates projects/repositories from that. It would assume one
    level of project-repository. Unless, of course, you build support for
    nested projects, which would be awesome.

    I see the above as an attractive installation/configuration option for
    people who want to switch to HgLab from an existing Mercurial installation.

    Thanks, again, for all your help.

  8. charles closed this discussion on 02 Oct, 2013 04:14 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Jan, 2025 05:02 PM
13 Jan, 2025 10:42 AM
29 Nov, 2024 10:00 AM
12 Jan, 2023 12:25 PM
10 Jan, 2023 04:49 PM