Hi @maliming, Nothing gets logged, dont know why, The job that was working multiple times and suddenly it stopped without making any changes in code. Is job getting triggered at your end? if yes please provide us that working sample.
@maliming Could you please revert urgently on above ? We are pressed for time for importing client data and this Background job working is very crucial .
Sample code Added.
We have followed this document link https://docs.abp.io/en/abp/latest/Background-Jobs to crate a job and implemented exactly like this but somehow that job is not getting triggered and as soon as entry get added in Background Table IsAbandoned flag set to true. Sometimes we also observed this behaviour is that it suddendly start executing job and again stopped working. Cean -> rebuild- > build project is working some times. its a weird things we are obeserving. Here is the sample code,
public enum ImportTableName
{
Test1 = 1,
Test2 = 2
}
[BackgroundJobName("ImportJob")]
public class BackgroundImportJobArgs
{
public string FilePath { get; set; }
public ImportTableName ImportTableName { get; set; }
}
public class BackgroundImportJob : AsyncBackgroundJob<BackgroundImportJobArgs>, ITransientDependency
{
private readonly IImportTblAppService importTbl;
public BackgroundImportJob(IImportTblAppService importTbl)
{
this.importTbl = importTbl;
}
public override async Task ExecuteAsync(BackgroundImportJobArgs args)
{
switch (args.ImportTableName)
{
case ImportTableName.Test1:
await importTbl.AddTest1(args.FilePath, args.ImportTableName);
System.IO.File.Delete(args.FilePath);
break;
default:
break;
}
}
}
public class ImportTblAppService : DemoAppService, IImportTblAppService
{
private readonly ITest1Repository _test1Repository;
private readonly IBackgroundJobManager _backgroundJobManager;
public ImportTblAppService(ITest1Repository test1Repository, IBackgroundJobManager backgroundJobManager)
{
_test1Repository = test1Repository;
_backgroundJobManager = backgroundJobManager;
}
public async Task AddTest1(string filePath, ImportTableName tablename)
{
/* Here contains Insert Logic */
}
public async Task ScheduleImportJob(string filePath, ImportTableName tablename)
{
await _backgroundJobManager.EnqueueAsync(new BackgroundImportJobArgs { FilePath = filePath, ImportTableName = tablename }).ConfigureAwait(false);
}
}
I have shared a project with you on git. Please let me know! Thanks
@Alper Could you please provide the necessary steps like should i download latest commecial project or As i am using ABP Commecrial Version v3.1.2 in that where i need to make changes. Please provide the link that will guide us.
Hello, We cannot use EF CORE as we are strictly developing the app using MongoDB.
Hello, Please send me the link how we can extend it without adding. Actually its a other part. My main issue is why its not redirecting to Dashboard page after login?
ABP Framework version: v3.1.2
UI type: MVC
Tiered (MVC): / no
Exception message and stack trace: 2020-10-07 04:23:16.969 +00:00 [ERR] Command aggregate failed: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason:** (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]}
ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4, Request URI: /apps/c56d70d4-0fbb-44da-8f3b-6ce6087ccf9b/services/3c16649d-2bb2-4531-abb0-09d4bd1a927c/partitions/192defda-7d84-4fba-b645-a2632c45d63c/replicas/132463302254650749s/, RequestStats: Please see CosmosDiagnostics, SDK: Windows/10.0.14393 cosmos-netstandard-sdk/3.3.2);););););.
MongoDB.Driver.MongoCommandException: Command aggregate failed: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]}**
ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4, Request URI: /apps/c56d70d4-0fbb-44da-8f3b-6ce6087ccf9b/services/3c16649d-2bb2-4531-abb0-09d4bd1a927c/partitions/192defda-7d84-4fba-b645-a2632c45d63c/replicas/132463302254650749s/, RequestStats: Please see CosmosDiagnostics, SDK: Windows/10.0.14393 cosmos-netstandard-sdk/3.3.2);););););.
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage) at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol
1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocolAsync[TResult](IWireProtocol1 protocol, ICoreSession session, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.RetryableReadOperationExecutor.ExecuteAsync[TResult](IRetryableReadOperation
1 operation, RetryableReadContext context, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.ReadCommandOperation1.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.AggregateOperation
1.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AggregateOperation1.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken) at MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync[TResult](IReadBinding binding, IReadOperation
1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.ExecuteReadOperationAsync[TResult](IClientSessionHandle session, IReadOperation
1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.AggregateAsync[TResult](IClientSessionHandle session, PipelineDefinition
2 pipeline, AggregateOptions options, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.UsingImplicitSessionAsync[TResult](Func
2 funcAsync, CancellationToken cancellationToken)
at MongoDB.Driver.IAsyncCursorSourceExtensions.ToListAsync[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken)
at Volo.Abp.Identity.MongoDB.MongoIdentityUserRepository.GetListAsync(String sorting, Int32 maxResultCount, Int32 skipCount, String filter, Boolean includeDetails, CancellationToken cancellationToken)
Steps to reproduce the issue: We have Host the Application on Azure and for database we have used Azure Cosmos Db with MongoDB API Version 3.6 application launch successfully but after login its not showing in LIST DATA for Users, Tenants everything wherever we used GetListAsync Method all got failed due to above exception. We also referred this link https://docs.microsoft.com/nl-nl/azure/cosmos-db/mongodb-troubleshoot but dont know how to solve this in ABPIO. this is our sample CosmosDB Connection String(its dummy for showing purpose) : "Default": "mongodb://ops-ai:ASDFeeZbaeQJMmhGujdWD6ZofiiChCmlR1TYHUkdp89QIAifHYTG8RaRsBthxpZ85mj8tWA9n6T8RuEIBeX4a45==@demo.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@demo@",
Any solution on High Priority will help us to move forward.
As we want extend/ make some changes in those module we added it.