I am using ECS service of AWS. I am using nest js application. We have couchbase database which is installed in EC2 instance. At the time of server up we fetch full data from couchbase by use of N1QL query.
whenever i create task of ECS it will converted into Deprovisioning status.
I added error message which is available in my docker container logs of ECS tasks.
FATAL ERROR:
libcouchbase experienced an unrecoverable error and terminates the program
to avoid undefined behavior.
The program should have generated a "corefile" which may used
to gather more information about the problem.
If your system doesn't create "corefiles" I can tell you that the
assertion failed in ../deps/lcb/src/mcserver/negotiate.cc at line 50
Aborted (core dumped)
If anyone has idea about it how to resolved it then please comment here.
Thanks!!
How can i solved this issue?
Below is my connection code for query.
export class CouchbaseService implements OnModuleInit {
private cluster: Cluster;
private bucket: Bucket;
private collection: Collection;
private isInit: boolean = false;
cols: Map<string, CollectionHelper> = new Map();
constructor(
private readonly configService: ConfigService,
@InjectSentry() private readonly sentry: SentryService,
) {}
async onModuleInit(): Promise<void> {
await this.connect();
}
async connect() {
// Make connection
this.cluster = await connect(this.configService.get('couchbase.url'), {
username: this.configService.get<string>('couchbase.username'),
password: this.configService.get<string>('couchbase.password'),
});
// Initialise bucket
this.bucket = this.cluster.bucket(
this.configService.get<string>('couchbase.bucket'),
);
this.collection = this.bucket.defaultCollection();
this.isInit = true;
console.log('COUCHBASE INITIATED');
}
query<T>(query: string, options?: QueryOptions) {
return this.handleErrors(async () => {
try {
const result = await this.cluster.query(query, options);
return result?.rows ? result?.rows : [];
} catch (e) {
console.log('N1QL ERROR: ', e);
return [];
}
});
}
}