Postgres Setup Storage Error

While connecting Chirpstack Application to Postgres I am getting this error:

Jul 30 11:32:18 Webapp-9 systemd[1]: Started ChirpStack Application Server.
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.395990481+05:30” level=info msg=“starting ChirpStack Application Server” docs=“https://www.chirpstack.io/” version=3.15.0
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.397202008+05:30” level=info msg=“storage: setting up storage package”
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.397234663+05:30” level=info msg=“storage: setup metrics”
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.397250712+05:30” level=info msg=“storage: setting up Redis client”
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.397279994+05:30” level=info msg=“storage: connecting to PostgreSQL database”
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.402782015+05:30” level=info msg=“storage: applying PostgreSQL data migrations”
Jul 30 11:32:18 Webapp-9 chirpstack-application-server[26143]: time=“2021-07-30T11:32:18.406586068+05:30” level=fatal msg=“setup storage error: storage: migrate up error: Dirty database version 35. Fix and force version.”
Jul 30 11:32:18 Webapp-9 systemd[1]: chirpstack-application-server.service: Main process exited, code=exited, status=1/FAILURE
Jul 30 11:32:18 Webapp-9 systemd[1]: chirpstack-application-server.service: Failed with result ‘exit-code’.
Jul 30 11:32:18 Webapp-9 systemd[1]: chirpstack-application-server.service: Service hold-off time over, scheduling restart.
Jul 30 11:32:18 Webapp-9 systemd[1]: chirpstack-application-server.service: Scheduled restart job, restart counter is at 5.
Jul 30 11:32:18 Webapp-9 systemd[1]: Stopped ChirpStack Application Server.
Jul 30 11:32:18 Webapp-9 systemd[1]: chirpstack-application-server.service: Start request repeated too quickly.
Jul 30 11:32:18 Webapp-9 systemd[1]: chirpstack-application-server.service: Failed with result ‘exit-code’.

I have tried creating a new database and still facing the same issue.

Are you using the same DB for both the AS and NS? In that case such error is expected. Both services must have their own DB.

I first used the same DB for both. After getting this error, I have created two new databases for NS and AS but it is still showing the same error.