i have a node backend running with postgres DB on AWS, but whenever i add a new column in existing table it works fine locally on port 8000 with that same DB, but after sometime suddenly i get this error in database ''' DatabaseError [SequelizeDatabaseError]: cache lookup failed for relation 66479 ''' , i have faced this error many time earlier and after few hours this gets fix automatically on the server. but is there any way to fix this error ? i am attaching the screenshot.
also this is happening when i restart my server when npm start runs
Related
Facing this issue for the last 2 days, tried every possible solution e.g reset cache, flushing dns, and everything that could reset ports, reinstalled VScode but nothing seems to work 1
The same connection string works when connecting without using prisma client 2
Here is the connection string in .env file
DATABASE_URL="mongodb+srv://alpha:alpha#cluster0.3fpvyik.mongodb.net/testing"
Even works with another project in which I am not using prisma 3
When trying to introspect, its giving this error! 4
Use-case: I am trying to write data from a nodejs process running locally (on a docker container) to my locally running postgres server (no docker container). The nodejs process is able to connect to the server (setting the address to host.docker.internal solved that problem) however, when I attempt a simple "SELECT * FROM contact LIMIT 1" query, this error is returned:
{"type":"postgres error","request":"SELECT * FROM contact",
"error":{
"name":"error","length":106,
"severity":"ERROR",
"code":"42P01",
"position":"15",
"file":"parse_relation.c",
"line":"1376",
"routine":"parserOpenTable"}}
The relation error suggests the table is not found-- I created this table using a postgres client (postico) and have been able to successfully query the table's contents with other pg clients as well
I see multiple posts are suggesting running the sequelize db:migrate command, but would this be the right solution here?
I did not create a model nor a migration, and created the table directly in the table. Is there something else I may be overlooking that is producing this error?
I was working in my express project and suddenly I got Database related error.
When I refreshed my mongoDB database it shows me an error related to DATA Destroyed.I was shocked .But I was having backup of my DB collections so I droped my database and did restore again but then also I got the same error after some .
When I tried to hit the API it works and fetch data.But in my mongo compass it shows null .
This happens me a lot in past two days.some times DB shows non of the data but when I tried to hit the API it works and fetch data some times & some times it shows error.
Is there any permanent solution for this?
Versions of packages I'm using :
mongoose: 5.6.1
Node : 1.18.10
Express: 4.16.3
I have been sitting at this computer for 7 hours straight trying to deploy my app. There is a node/express backend serving up restricted API json data at different endpoints. In order to get access to this json data you have to have a token.
It all works fine and dandy on my local server during development. However, when I go to send the migrations to heroku (using 'heroku run bash', then 'sequelize db:migrate), I get some random error saying "SyntaxError: Unexpected String"..as shown below.
As you can see, when I run sequelize:db:migrate:undo, it says that no executed migrations found.
```
Sequelize [Node: 5.11.1, CLI: 2.4.0, ORM: 3.24.3, pg: ^6.1.0]
Loaded configuration file "config/config.json".
Using environment "production".
== 20160917224717-create-user: migrating =======
[SyntaxError: Unexpected string]
~ $ sequelize db:migrate:undo
Sequelize [Node: 5.11.1, CLI: 2.4.0, ORM: 3.24.3, pg: ^6.1.0]
Loaded configuration file "config/config.json".
Using environment "production".
No executed migrations found.
~ $
```
However, when I look in my heroku database, I DO see that there is now 1 table. However, that table does not work, and I am still getting an error on form submit to create a user. The error I get on form submit is:
message: "relation "users" does not exist"
name: "SequelizeDatabaseError"
What gives? This alleged syntax unexpected string error does not throw when I am running locally. It runs smooth as butter with the migrations. What could this be?
Thanks.
Either you have not updated your code on the server to match your local environment or your database does not match. "Users relation" implies the users table is related to another table. Make sure the code is really updated (if sequelize code mentions this relation) AND all other tables are reproduced on the server.
Once I got a problem with accessing postgres db on Heroku (provided as an add-on):
I installed SQL Shell (psql) on my laptop
I logged-in to the db (used all necessary credentials)
run: \dt to check db schema => result: 'no relations', so the migration wasn't done yet
run migrate:db
run: \dt => schema is here - OK!
now: run heroku console
login to your account
run: heroku restart -a=<my_app>
If the lack of db:migration was a problem only, it should be fine now.
You can also try to reset your db first (if your data isn't precious!) running: heroku pg:reset -a=<my_app>
I have a script that periodically runs aggregation on a mongodb collection. As the dataset has grown, the amount of time it takes to aggregate has also grown. My aggregation script has recently stopped working consistently, and the error logs show:
error: { [MongoError: server <x> timed out]
name: 'MongoError',
message: 'server <x> timed out' }
I've tried debugging this, and the only pattern I can find is that this timeout seems to only occur when the aggregation takes longer than 2 minutes (it times out right around 2m). Does anyone have additional debugging tips for this? The 2-minute thing is giving me the impression that I just need to configure some timeout somewhere but I can't figure out where or if i'm just falling into a red-herring trap.
About the system configuration: This aggregation script is a node.js (v5.9.1) application running in an alpine-based docker (v1.9.1) container. It uses the mongodb node driver (v2.1.19). Single mongodb server (though this is also happening in a separate environment with a replSet) running mongod (v3.2.6)
I got the same problem for logs time aggregation. I think I have the solution for you.
I found that the option socketTimeoutMS is responsible for that.
Check your mongo_client.js default socketTimeoutMS value. For me it was 2min. Mongodb module version 2.1.18.
So just add this option into your url :
mongodb://localhost:27017/test?maxPoolSize=2&socketTimeoutMS=60000
It will set timeout to 10 mins. That does the trick for me.