Skip to main content
Solved

Error: Database could not be accessed


Currently I am using CLI to spin up an Acumatica EC2 instance. I am getting this “Database could not be accessed” error despite having my Web.config set up properly. 

I am using SQL Server Authentication, not Windows Authentication. I believe the Acumatica instance is connected to the database server.

In my Web.config:

<add name="ProjectX" providerName="System.Data.SqlClient" connectionString="Data Source=[DBServerName];Initial Catalog=[DBName];Integrated Security=False;User ID=[UserID];Password=[Password];Encrypt=True;trustServerCertificate=True" />

Assume all the values in brackets [] are replaced with their respective values. 

 

When performing database maintenance, the maintenance proceeds, but I get the following error at the start: 
[22:23:55 ERR] The database cannot be upgraded because of the following errors:
Table AppRestartRequest does not have a primary key. Primary key is required for every table in the database.
Table DispatcherSettings does not have a primary key. Primary key is required for every table in the database.
Table DummyTable does not have a primary key. Primary key is required for every table in the database.

As a result, I tried manually dropping the tables. When performing maintenance afterwards, these tables would reappear without the keys. I suspect this might be unrelated to the initial database access error, as maintenance does complete successfully despite these warnings.

I've already tried creating fresh EC2 and RDS instances but continue to face the same issue.

Has anyone encountered similar problems or have suggestions for troubleshooting steps I might have missed? I’ve reviewed the existing threads but they don’t seem to address this issue.

 

 Additionally, how do we access the trace logs for errors like this? Where are they located?

 

 

Best answer by shuang

Hi, thank you all for the responses.

What fixed the issue was: Dropping the DB and recreating it by performing database maintenance. Doing DB maintenance without dropping the DB didn’t seem to fix the issue.

 

 

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img
  • Jr Varsity III
  • 29 replies
  • March 12, 2025

@shuang Can you try change the database instance in the Acumatica Configuration Wizard to perform database maintenance. Here’s the documentation link for the steps

https://help-2022r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=fc906c62-c65b-44d6-8210-13d9cea2b88d


Forum|alt.badge.img

 Hi @shuang,

Are there any customizations included? I believe you need to build the solution with the upgraded version, and it should resolve the issue.

Hope, it helps!


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • March 12, 2025

Hi ​@shuang,

 

Similar to what ​@Ankita Tayana said, I have experienced this when building/rebuilding solutions.

What fixed it for me was, repairing the database, rebuilding the solution, and sometimes just refreshing the web page helped.

I have also seen an article which recommended restarting IIS.

 

Aleks


Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+13

@shuang 

Try perform database maintenance by just reselecting the DB instance using Acumatica configuration wizard. That should update the DB server details of the instance. Here is the documentation link for the step I am referring to. 

https://help-2022r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=fc906c62-c65b-44d6-8210-13d9cea2b88d


  • Author
  • Freshman II
  • 1 reply
  • Answer
  • March 12, 2025

Hi, thank you all for the responses.

What fixed the issue was: Dropping the DB and recreating it by performing database maintenance. Doing DB maintenance without dropping the DB didn’t seem to fix the issue.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings