Copied to clipboard

Flag this post as spam?

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


  • Nathan 2 posts 92 karma points
    Dec 14, 2022 @ 20:12
    Nathan
    0

    v10 Visual Studio Install. SQLite Error 14: 'unable to open database file.'

    Context: Install base Umbraco 10.3.2 in VS 2022 (17.4.2) using the Umbraco Project Template - create dev environment.

    Using SQLite

    I am unable to get past the Umbraco install page.

    After the Umbraco 10 install page, this error is shown in the browser: Didn't retrieve updated connection string within 10 seconds, try manual configuration instead.

    Logs are full of SQLite exceptions as in the title:

    Microsoft.Data.Sqlite.SqliteException (0x80004005) : SQLite Error 14: 'unable to open database file.'

    My connection string:

    "ConnectionStrings": {
        "umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Private;Foreign Keys=True;Pooling=True",
        "umbracoDbDSN_ProviderName": "Microsoft.Data.SQLite"
    }
    

    I managed to get it working once, I think, by installing in a new project in the default ~/source/repos folder but this no longer seems to be working with similar errors.

    Had an almost identical problem when I tried to add this base Umbraco project to an existing solution in a OneDrive folder.

    This feels like a file permission issue for the IIS Express process, however, the app is able to write the log files to ~/Umbraco/Logs/ and create those folders.

    Things I have tried:

    1 Create the App_Data folder in the project and change the database location to this in the connection string.

    2 Add this to the .csproj file:

    <PropertyGroup>
    <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
    </PropertyGroup>
    

    This changed the process name in the logs but errors were the same.

    dotnet version is 7 but the 5 and 6 SDKs are installed.

    Further context: The plan is to get Umbraco with uSkinned up and running so my less technical colleagues can build some content. Later I will be integrating most of an existing MVC application into the Umbraco site to combine with custom personalised content for our users.

    I would like to set up my dev environment and devops workflow in VS to make use of the live debugging features I am familiar with.

    I will probably try the plain dotnet install tomorrow. Will try to update with my progress.

    Any ideas? Uninstall and reinstall everything? :(

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Dec 15, 2022 @ 04:47
    Huw Reddick
    1

    Have you tried running visual studio as administrator?

  • Nathan 2 posts 92 karma points
    Dec 15, 2022 @ 18:48
    Nathan
    100

    Have not tried Huw's suggestion yet, but I have got it up and running by installing into the default home repo folder and not changing any of the pre-install options for the template.

    There are two separate issues:

    1. New install will throw these errors in a google drive (virtual?) partition / G drive. These exist under G:/. (I will push to bitbucket anyway). Have not tried OneDrive.

    2. Do not change the database type from 'none' in the initial template options. Change this to SQLite without any other details and the initial setup appears to expect an existing database. Leave this as 'none' and it will create a new SQLite DB file.

    Still getting my head around the architecture but I might end up using a shared SQL Server DB that both Dev and Staging point to anyway to avoid issues with synching work.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Dec 15, 2022 @ 19:01
    Huw Reddick
    0

    Re: point two, I always pre select database type when creating a new project, it has not caused any issues for me so far.

    I would definitely recommend a shared db instance if you have multiple developers working on the same project.

Please Sign in or register to post replies

Write your reply to:

Draft