Data API Proxy stopped working

I updated Otto FMS to the latest version and my Data API proxy stopped working. It gets a 401 Unauthorised response. A ‘normal’ connection to the Data API works ok still.
Things I have tried to resolve this:

  • regenerating API Key
  • regenerating account in FM file
  • rebooting the server
  • upgrading FMS to latest version
  • reinstalling Otto FMS
  • downgrading Otto FMS to previous (working) version - this last step has now meant that I get a 500 error when attempting to load https://server/otto/app/api-keys/data-api with the message no such table: api_keys

Any ideas on how I can fix this?

Hi Matt,

Sorry in order to downgrade in this case, you will need to remove the db.sqlite database from the data directory. This particular upgrade, changed the schema, so the old code won’t be able to connect to that upgraded database. You will loose all data in there, which means any other API Keys that you have in there. Sorry that isn’t great.

If you happen to have a backup of the data directory you could pull the db.sqlite from there, and that would fix the downgrade problem.

Most upgrades don’t have a schema change so this isn’t an issue. In the future, we will make a backup first.

I would go back to the current version. I think that is your best bet. Then I would try to make a new API key.

Note that now you can create keys that work with both oData and the Data API. That might be causing some issue. So to work around that make sure that your file has both Data API and oData Privs, turn on both connectors on the server, and make a key that handles both. It maybe that we missed something, if for example oData was turned off on the server.

Let us know what happens, and if it still doesn’t work, let us know what OS and version your server is, and we can try to dig deeper.

Thanks

Todd

I have a new idea about down grading, if you need to save the APIkeys.

keep the db.sqlite database. Move it somewhere else. You can open that with any sqlite db editor. That will let you pull all the data out you want. you’ll be able to get the API keys you want to save out.

Then after you moved the sqlite db. Downgrade to 4.10.3. That will create a new db.sqlite. If you stop OttoFMS you should be able to open that new file with any sqlite editor and put back the API keys you need to save.

Make sense?

Todd

Hi Todd

Thanks for the quick reply. Removing everything and reinstalling was going to be my next try. This is a dev server for a client, so there isn’t much data to lose.

I think I did try creating keys that were enabled for both DataAPI and oData, but I’ll go back to the latest OttoFMS and try again to confirm.

Will keep you posted.

Thanks

Matt

I updated to the latest version of OttoFMS again, ensured that the FM account was enabled for DataAPI and oData access and restarted both the DataAPI and oData on FMS. I created a new API key and enabled it for both DataAPI and oData. Had the same issue unfortunately when I tried to connect. I see this in the otto-info log: 2025-06-03T13:36:40.234Z error UnauthorizedError: Api Key is invalid. #ref1 - {"service":"express-error-handler"}

I then uninstalled OttoFMS again, removed all of the config / data / log files and installed 4.10.3. Added a new API key and it worked. So I guess that the latest version broke something, at least in this environment.

Let me know if you want me to recreate the ‘broken’ set up again and send you log files to review? I can do that after hours if needed.

Thanks for the help

Matt

Thanks Matt

Yes the logs would be useful. We do run a lot of tests before releasing a new version and none of them are turning up this issue, so any clues about what might be different about this could be helpful in tracking down this edge case.

Things like
is it just this file?
is it just these credentials?

So if you could send us the file and the credentials back channel, we can try it here.

Thanks

Todd