<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SQLITE_ERROR: no such table: localized_AdminService_Authors in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257744#M4590776</link>
    <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Did you deploy your database artifacts?&lt;/P&gt;&lt;P&gt;-&amp;gt; cds deploy --to sqlite&lt;/P&gt;&lt;P&gt;Alternatively, you can run&lt;/P&gt;&lt;P&gt;-&amp;gt; cds watch&lt;BR /&gt;to automatically redeploy and restart on file changes.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;David&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2020 08:28:51 GMT</pubDate>
    <dc:creator>david_kunz2</dc:creator>
    <dc:date>2020-08-10T08:28:51Z</dc:date>
    <item>
      <title>SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaq-p/12257743</link>
      <description>&lt;P&gt;Hi, in an attempt to learn about the authentication and authorisation in CAP apps on Cloud Foundry I have been using this documentation &lt;A href="https://cap.cloud.sap/docs/node.js/authentication"&gt;https://cap.cloud.sap/docs/node.js/authentication&lt;/A&gt;.&lt;/P&gt;
  &lt;P&gt;In summary, I have run through the &lt;A href="https://cap.cloud.sap/docs/get-started/in-a-nutshell"&gt;https://cap.cloud.sap/docs/get-started/in-a-nutshell&lt;/A&gt; guide in the CAP documentation, followed by the "Token-Based Authentication (JWT)" section in the authentication documentation I linked to above, all the way through to the final step just &lt;STRONG&gt;before&lt;/STRONG&gt; the "Custom Authentication Middleware" section.&lt;/P&gt;
  &lt;P&gt;When I am running my CAP service to test it, in an incognito window, I am made to log in as expected, but then when I try and access my Admin service which is protected by the admin role I receive the following error.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;GET /admin/Authors
[2020-08-10T07:47:48.189Z | ERROR | 1431319]: SQLITE_ERROR: no such table: localized_AdminService_Authors
[2020-08-10T07:47:48.189Z | ERROR | 1431319]: Error stacktrace: Error: SQLITE_ERROR: no such table: localized_AdminService_Authors
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I have tried a few things I found in other answers which sounded similar however none of those have worked. Any help would be much appreciated. I have included file I think may be relevant below.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;package.json
{
  "name": "authtest",
  "version": "1.0.0",
  "description": "A simple CAP project.",
  "repository": "&amp;lt;Add your repository here&amp;gt;",
  "license": "UNLICENSED",
  "private": true,
  "dependencies": {
    "@sap/audit-logging": "^3.1.1",
    "@sap/cds": "^4.1.5",
    "@sap/xsenv": "^3.0.0",
    "@sap/xssec": "^2.2.5",
    "express": "^4",
    "passport": "^0.4.1"
  },
  "devDependencies": {
    "sqlite3": "^4.2.0"
  },
  "scripts": {
    "start": "npx cds run"
  },
  "cds": {
    "hana": {
      "deploy-format": "hdbtable"
    },
    "requires": {
      "db": {
        "kind": "sql"
      },
      "auth": {
        "strategy": "JWT"
      },
      "uaa": {
        "kind": "xsuaa"
      }
    }
  }
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;xs-app.json
{
  "routes": [ {
    "source": "^/(.*)",
    "destination": "srv_api"
   } ]
 }
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;admin-service.cds

using { sap.capire.bookshop as my } from '../db/schema';

service AdminService @(requires:'admin') {
  entity Books as projection on my.Books;
  entity Authors as projection on my.Authors;
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2020 08:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaq-p/12257743</guid>
      <dc:creator>jbm1991</dc:creator>
      <dc:date>2020-08-10T08:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257744#M4590776</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Did you deploy your database artifacts?&lt;/P&gt;&lt;P&gt;-&amp;gt; cds deploy --to sqlite&lt;/P&gt;&lt;P&gt;Alternatively, you can run&lt;/P&gt;&lt;P&gt;-&amp;gt; cds watch&lt;BR /&gt;to automatically redeploy and restart on file changes.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 08:28:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257744#M4590776</guid>
      <dc:creator>david_kunz2</dc:creator>
      <dc:date>2020-08-10T08:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257745#M4590777</link>
      <description>&lt;P&gt;Thanks for the quick reply  &lt;SPAN class="mention-scrubbed"&gt;david.kunz2&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;cds watch is how I'm currently running the data service already, however I have tried your other suggestion, but that hasn't made any difference unfortunately. &lt;/P&gt;&lt;P&gt;I think an extension to my original question might be, why is it asking for/trying to use localized tables only after I added authentication? If I remove the "requires:'admin'" from the admin service then it returns the data correctly&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 08:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257745#M4590777</guid>
      <dc:creator>jbm1991</dc:creator>
      <dc:date>2020-08-10T08:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257746#M4590778</link>
      <description>&lt;P&gt;Hi John,&lt;BR /&gt;This is indeed a strange behavior. Which version of  @sap/cds are you using?&lt;/P&gt;&lt;P&gt;cds -v&lt;/P&gt;&lt;P&gt;Did you try with the latest one (4.1.5)&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 09:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257746#M4590778</guid>
      <dc:creator>david_kunz2</dc:creator>
      <dc:date>2020-08-10T09:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257747#M4590779</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;I am using the latest version of  @sap/cds. Please see below for reference:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cds -v         
@sap/audit-logging: 3.1.1
@sap/cds: 4.1.5
@sap/cds-compiler: 1.35.0
@sap/cds-dk: 2.0.7
@sap/cds-foss: 2.0.0
@sap/cds-reflect: 2.12.2
@sap/cds-runtime: 2.1.5
@sap/xsenv: 3.0.0
@sap/xssec: 2.2.5
Node.js: v12.16.1
authtest: 1.0.0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2020 12:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257747#M4590779</guid>
      <dc:creator>jbm1991</dc:creator>
      <dc:date>2020-08-10T12:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257748#M4590780</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Can you please share your project so we can reproduce?&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;BR /&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 06:57:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257748#M4590780</guid>
      <dc:creator>david_kunz2</dc:creator>
      <dc:date>2020-08-19T06:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257749#M4590781</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;I've encountered the same issue after updating my &lt;STRONG&gt;schema&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;To solve it, I've recreate/redeploy to the SQLite dev. Other script was inserted in &lt;STRONG&gt;package.json&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
...,
"scripts": {
    "start": "npx cds run",
    "dev":"npx cds watch",
    "dev:db-sync": "cds deploy --to sqlite:raprincis.db",
    "dev:db-deploy": "npx sqlite3 raprincis.db .dump &amp;amp;&amp;amp; sqlite3 raprincis.db .tables",
    "dev:db": "npm run dev:db-sync &amp;amp;&amp;amp; npm run dev:db-deploy"
  },
  "cds": {
    "requires": {
      "db": {
        "kind": "sqlite",
        "credentials": {
          "database": "raprincis.db"
        }
      }
    }
  }
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;&lt;P&gt;And at the end I run:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;npm run dev:db&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Sep 2020 14:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257749#M4590781</guid>
      <dc:creator>former_member268422</dc:creator>
      <dc:date>2020-09-04T14:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257750#M4590782</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;I had the exact same issue, and it took me a couple of time to figure out the solution, though, I am not sure what was the reason.&lt;/P&gt;&lt;P&gt;I was using BAS, and what I had to do was to &lt;STRONG&gt;cds deploy --to sqlite&lt;/STRONG&gt; again and then re-start the service. &lt;/P&gt;&lt;P&gt;Before, I had the issue with CDS watch returning 
     "Cannot find module 'sqlite3'", so I had to do the following to get at least the metadata displayed: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In root folder of application
     (e.g. bookshop/): &lt;STRONG&gt;npm install&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Afterwardds, for all
     terminals: &lt;STRONG&gt;unset NODE_PATH&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Afterwards: &lt;STRONG&gt;cds deploy
     --to sqlite&lt;/STRONG&gt; &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Maybe somebody from SAP could enlighten us what went wrong. I just followed the instructions from here: &lt;/P&gt;&lt;P&gt;&lt;A href="https://open.sap.com/courses/cp7/items/5QKEq8Yz5ZcCticDU8KGAz" target="test_blank"&gt;https://open.sap.com/courses/cp7/items/5QKEq8Yz5ZcCticDU8KGAz&lt;/A&gt;&lt;/P&gt;&lt;P&gt;as shown by  &lt;SPAN class="mention-scrubbed"&gt;johannesvogel&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Aleks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 15:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/12257750#M4590782</guid>
      <dc:creator>former_member596519</dc:creator>
      <dc:date>2021-01-06T15:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: SQLITE_ERROR: no such table: localized_AdminService_Authors</title>
      <link>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/13859996#M4882706</link>
      <description>&lt;P&gt;Hi I know this is an old post but I am currently doing this same training project and I have the same issue. I'm surprised there isn't a more definitive solution 4 years later but I got it to work.&lt;/P&gt;&lt;P&gt;I have had this problem before on other frameworks and the problem lies in the package-lock.json file. Delete that file, do an 'npm install' and redeploy with 'cds deploy'. That should refresh the package-lock file and update it and work.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 19:43:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sqlite-error-no-such-table-localized-adminservice-authors/qaa-p/13859996#M4882706</guid>
      <dc:creator>MattRook</dc:creator>
      <dc:date>2024-09-09T19:43:55Z</dc:date>
    </item>
  </channel>
</rss>

