0

So I had run into a problem when I attempted to host a web application. Everything works fine in visual studio and when I use IIS express for debugging, but when I publish it and upload it to my server to be hosted this error pops up (title). I am of course using sqlite3 as a database, the file is located outside the project itself and the data source path is correct, I've tried to publish it both when the file is inside the project (inside wwwroot, with data source being just /dbname.db) and outside but in both instances sqlite error 14 comes up.

Note that the solution to this problem might be as simple as adjusting some permissions if lets say that is the cause of the problem as I am not really that experienced in using IIS yet.

M W
  • 1
  • 1
  • 1
    Most likely is a permission issue. The app pool must have write access to that folder – Sami Kuhmonen Jun 23 '19 at 19:16
  • https://blog.lextudio.com/web-application-differences-in-visual-studio-and-iis-60fec7e311b3 Learn the multiple differences please. – Lex Li Jun 23 '19 at 20:56
  • @Sami Kuhmonen the more I read about it the more it seems to be the case, could you explain how one would set the permissions so that the database can be accessed or point me in a direction where I can learn? Thanks in advance :) – M W Jun 25 '19 at 19:52
  • If you give read/write access to `IIS Apppol\poolname` you can see if this is the problem. Note the three p’s there. The poolname is the one that’s running the application on IIS – Sami Kuhmonen Jun 25 '19 at 19:55
  • Instead of using app-pool name you could use `IIS_IUSRS` group. Be sure to set read and write permission on the folder as well. Just learned by trial-and-error that only setting Read-Write permissions to the sqlite database file isn't enough. – ArieKanarie Oct 18 '19 at 10:09

0 Answers0