Copied to clipboard

Flag this post as spam?

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


  • Janne Mårtensgård 10 posts 211 karma points
    Jun 11, 2021 @ 13:56
    Janne Mårtensgård
    0

    Installing Umbraco 9 on Mac OS

    Hi all,

    Inspired by the ongoing CodeGarden I tried installing the latest Umbraco 9 on my Macbook Pro. Installing goes smoothly (using a SQL Server Express database on a separate machine) but when the installation is done and the installer tries redirecting into Umbraco I'm met with the following error message: System.InvalidOperationException: Unable to convert user ID to int ---> System.InvalidCastException: Unable to cast object type 'System.String' to type 'System.Int32'

    Clearing cookies and restarting the service does not help, the site backend is broken at this point. Have tried using both beta 3 and the latest nightly with the same result. dotnet --version reports 5.0.301.

    Anyone else run into this and found a solution/workaround?

  • Bjarke Berg 26 posts 222 karma points hq
    Jun 11, 2021 @ 14:03
    Bjarke Berg
    0

    This sounds like a bug. Do you have more stacktrace?

    I have no idea why this should be specific to running on Mac?

  • Janne Mårtensgård 10 posts 211 karma points
    Jun 11, 2021 @ 14:42
    Janne Mårtensgård
    0

    Yes, I found it confusing too - but installing the beta on my Windows machine (using the same database server) works just fine.

    Will paste the stacktrace below:

    System.InvalidOperationException: Unable to convert user ID to int ---> System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Int32'. at Umbraco.Extensions.ObjectExtensions.TryConvertTo[T](Object input) --- End of inner exception stack trace --- at Umbraco.Cms.Core.Security.UmbracoUserStore2.UserIdToInt(String userId) at Umbraco.Cms.Core.Security.BackOfficeUserStore.FindUserAsync(String userId, CancellationToken cancellationToken) at Umbraco.Cms.Core.Security.UmbracoUserStore2.FindByIdAsync(String userId, CancellationToken cancellationToken) at Microsoft.AspNetCore.Identity.UserManager1.FindByIdAsync(String userId) at Umbraco.Cms.Web.BackOffice.Install.InstallApiController.CompleteInstall() at lambda_method271(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|100(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|240(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|170(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.gAwaitRequestTask|60(Endpoint endpoint, Task requestTask, ILogger logger) at Umbraco.Cms.Web.Website.Middleware.PublicAccessMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>cDisplayClass61.DisplayClass61.

  • Bjarke Berg 26 posts 222 karma points hq
    Jun 11, 2021 @ 15:02
    Bjarke Berg
    0

    Did you use a new empty database, or was the database generated from another project? You say "using the same database server", does that mean the database was 1) Originally made on windows and connected to on mac, where it fails 2) Originally made on mac and connected to, but failing. Then connection from windows where it works?

  • Janne Mårtensgård 10 posts 211 karma points
    Jun 11, 2021 @ 17:01
    Janne Mårtensgård
    0

    I first tried using a Linux SQL Server instance running in a Docker container (failed with the same error) but then moved over to a SQL Server Express 2016 database on our (Windows) development server. All databases were empty at the point of Umbraco installation and connected to from Umbraco using the SA account. The Express databases were created using SQL Management Studio Express.

    It feels like I followed the installation instructions pretty closely to what Warren's doing here: https://www.youtube.com/watch?v=lDL9tsJojfs However, I'm still on Catalina if that could be a factor.

  • Bjarke Berg 26 posts 222 karma points hq
    Jun 11, 2021 @ 19:00
    Bjarke Berg
    0

    I have no idea if or how that should be the problem.. Based on the stacktrace, it should be the same as executing this code.

    "-1".TryConvertTo<int>()
    

    Are you somehow able to execute similar code in a simple example?

    Maybe as first thing in public static void Main(string[] args)? And then maybe you can debug and see what is going wrong?

    Personally I can only test on windows and ubuntu

  • Janne Mårtensgård 10 posts 211 karma points
    Jul 14, 2021 @ 14:07
    Janne Mårtensgård
    0

    Just as a heads up: I just tried installing the RC on the same mac and it resulted in the same crash as earlier. I also did try to make a new console app (adding the Umbraco.Cms package and a reference to Umbraco.Extensions in the code) and execute the code you quoted above. That worked just fine, no error at all, so the problem does not look like it's in the extension method.

    Unfortunately I don't have access to another Mac with a more recent OS to see if it's something weird on my machine or if it is indeed a macos related problem.

  • Huw Reddick 533 posts 1723 karma points
    Jun 11, 2021 @ 15:50
    Huw Reddick
    0

    Does sound like it's specific to Mac, I have tested install on Windows and Raspberry Pi, both went very smoothly

  • Conklin 2 posts 72 karma points
    Jun 12, 2021 @ 06:44
    Conklin
    0

    This will boot the project, and write the log to the console. The website is now running on the Kestrel server, it will be available on the ports written in the console.

  • x3x4x5 2 posts 71 karma points
    Jul 29, 2021 @ 08:05
    x3x4x5
    0

    I get the same error when using Umbraco 9 in Linux Docker. Did anyone find a fix?

  • Janne Mårtensgård 10 posts 211 karma points
    3 days ago
    Janne Mårtensgård
    1

    Another heads up: this could possibly have to do with .net 5 doing some weird things with string parsing in some certain cultures, as Shannon writes about here: https://twitter.com/Shazwazza/status/1437842495627403265

    As I'm working on a Mac with the OS set to Swedish culture, it would make sense.

  • Bjarke Berg 6 posts 129 karma points hq
    1 day ago
    Bjarke Berg
    0

    This is identified as a bug, and will be fixed in next RC

  • goyalmanik22 1 post 71 karma points
    10 hours ago
    goyalmanik22
    0

    I have no idea why this should be specific to running on Mac?

Please Sign in or register to post replies

Write your reply to:

Draft