Event not received on ropsten Test Network

I have a problem with event listening. I am connecting to the Infura via WebSockets and I am able to receive events, when some transaction happens, but at some point of time, events are not coming anymore, although a transaction is made.

I am refreshing the socket every 30 minutes(tried also with 15 and 45 mins). The whole functionality is deployed on the VPC(VPN for AWS). So the server on which is Infura connection made is running behind a proxy. But again, I am receiving events for some period of time, sometimes 10h, sometimes 1h, but at a some point of time, events aren’t received anymore.

The strange thing is that when I run it locally, everything works fine, every event is received. Also I’ve tried to run it on the EC2(without VPC), it also runs without any problem there. Actually it runs there for last 2 months without any problems.

Here is the code:

contractInstance.events.someEvent({
   fromBlock: 0,
   toBlock: "latest"
}, (error, event) => console.log("Event received!"); )
.on('data', async (event) => {
   // doSomething
})
.on('error', console.error);

NOTES:

  • I don’t get any error.
  • the smart contract is deployed on the Ropsten Test network

Do you have any information about this kind of a problem or something similar? Would be very helpful, because everything I tried didn’t work. Thanks in advance!

Can you also provide the code where your provider is defined and the full request is being generated?

Are you using an Infura dashboard generated Project ID with your request?

Can you provide more detail on what client-side library you are using? @PendicGordan