Error occured while downloading source-code from https://abp.io/api/download/module/ : StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
Date: Mon, 20 Jun 2022 05:22:47 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache,no-store
Pragma: no-cache
Set-Cookie: .AspNetCore.Antiforgery.VyLW6ORzMgk=CfDJ8IorD5SOpnxGgOdkbncQqV0VrfB2SfkqZpTCVNxdOTJQD_Fkx-tjdDXUaA7JSd4l2EQqjokXh48EUtY92ZNTJUEFOwkBj-81kH4oWwjve-ldwK056EKgY8cdzqxOz9rEbErbBsnR6oINseC1Gsnsd44; path=/; samesite=strict; httponly Set-Cookie: XSRF-TOKEN=CfDJ8IorD5SOpnxGgOdkbncQqV24xYsrO0WQzdOPb16_KrS1RRj4ODbpq75wYMeKgfxNyh3ZUd1EYmevmbLpALgF1wP8ofX1kMh7pH8b_cZ0ifRpVbWpJHCLOKc8cQPM-tT-xMBE4EibpCGI8xqoOt0VDH_Rn11aZ5n0Zo8hz3L6vkA0KgxT9aIx0MrR37Aci4PZwg; expires=Thu, 17 Jun 2032 05:22:47 GMT; path=/; secure; samesite=none
Strict-Transport-Security: max-age=2592000
X-Frame-Options: SAMEORIGIN
X-Powered-By: ARR/3.0
X-Powered-By: ASP.NET
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Report-To: {"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v3?s=7tJNpv%2Fs8TUSu5pWfbjPy%2FsPzzSCNC4Kbb7BgS71qdjIkmiiIZyVSaASLjAqJR2g0zHV7eE%2F%2BEIn2KOQJwr%2FCN0F5CYFWDGqciNtCEXrMi3XBCaRoio%2B2w%3D%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 71e211936aa0b454-HKG
Content-Type: text/html; charset=utf-8
Expires: -1
}
'<' is an invalid start of a value. Path: $ | LineNumber: 1 | BytePositionInLine: 0.
[09:22:48 ERR] Error occured while adding the module Volo.FileManagementwith source-code to the solution "41982fe2-7d52-4959-adfe-435a3c7e7283".. System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 1 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 1 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at Volo.Abp.Json.AbpHybridJsonSerializer.Deserialize[T](String jsonString, Boolean camelCase) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Json\Volo\Abp\Json\AbpHybridJsonSerializer.cs:line 40
at Volo.Abp.Cli.ProjectBuilding.RemoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(HttpResponseMessage responseMessage) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\RemoteServiceExceptionHandler.cs:line 52
at Volo.Abp.Cli.ProjectBuilding.RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(HttpResponseMessage responseMessage) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\RemoteServiceExceptionHandler.cs:line 45
at Volo.Abp.Cli.ProjectBuilding.AbpIoSourceCodeStore.DownloadSourceCodeContentAsync(SourceCodeDownloadInputDto input) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\AbpIoSourceCodeStore.cs:line 251
at Volo.Abp.Cli.ProjectBuilding.AbpIoSourceCodeStore.GetAsync(String name, String type, String version, String templateSource, Boolean includePreReleases) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\AbpIoSourceCodeStore.cs:line 119
at Volo.Abp.Cli.ProjectBuilding.ModuleProjectBuilder.BuildAsync(ProjectBuildArgs args) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\ModuleProjectBuilder.cs:line 48
at Volo.Abp.Cli.Commands.Services.SourceCodeDownloadService.DownloadModuleAsync(String moduleName, String outputFolder, String version, String gitHubAbpLocalRepositoryPath, String gitHubVoloLocalRepositoryPath, AbpCommandLineOptions options) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\Services\SourceCodeDownloadService.cs:line 40
at Volo.Abp.Cli.ProjectModification.SolutionModuleAdder.DownloadSourceCodesToSolutionFolder(ModuleWithMastersInfo module, String modulesFolderInSolution, String version, Boolean newTemplate, Boolean newProTemplate) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\SolutionModuleAdder.cs:line 488
at Volo.Abp.Cli.ProjectModification.SolutionModuleAdder.AddAsync(String solutionFile, String moduleName, String version, Boolean skipDbMigrations, Boolean withSourceCode, Boolean addSourceCodeToSolutionFile, Boolean newTemplate, Boolean newProTemplate) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\SolutionModuleAdder.cs:line 121
at Volo.Abp.Cli.Commands.AddModuleCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\AddModuleCommand.cs:line 68
at Volo.Abp.Suite.Controllers.AbpSuiteController.AddModuleAsync(AddModuleInput input)
I am using IBlobContainer with Azure Blob Storage to save files. When I enabled multi-tenant files are keeping inside the tenant folder perfectly. My question is how can I create a new folder and place the files inside tenant folder and get that files from that folder?
this is the current path files/tenants/{tenant_id}/{file_name} I want to place it like files/tenants/{tenant_id}/{my_custom_folder}/{file_name}
I managed to Implement IDistributedEventHandler inside BookManager class. Now it is working..
Ok, I will make a small sample and share it with you. One more thing I noticed, I created a new Class inherited from ApplicationService and implemented IDistributedEventHandler, and paste all coding, which is working fine.
The main difference between the two classes is One is inherited from DomainService and The Other is ApplicationService. If you have any clue just check.
public class BookManager : DomainService Inside this class code is throwing exception
public class BookAppDistEventService : ApplicationService, IDistributedEventHandler<APIBookEto> Inside this class code is working fine.
Yes, It is passing through but the exception is thrown again where DBContext is accessing.
at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
at Microsoft.EntityFrameworkCore.DbContext.get_Model()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityType() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.CheckState()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityQueryable() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable1 source, Expression1 predicate)
at Akadimi.Books.BookManager.<SetBookAuthorsAsync>d__9.MoveNext() in D:\Akadimi\Akadimi\aspnet-core\src\Akadimi.Domain\Books\BookManager.cs:line 123
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Akadimi.Books.BookManager.<CreateAsync>d__7.MoveNext() in D:\Akadimi\Akadimi\aspnet-core\src\Akadimi.Domain\Books\BookManager.cs:line 63
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Akadimi.Books.BooksAppService.
public class BooksAppService: ApplicationService, IBooksAppService, IDistributedEventHandler<APIBookEto>
{
private readonly BookManager _bookManager;
public BooksAppService(BookManager bookManager)
{
_bookRepository = bookRepository;
_bookManager = bookManager;
}
public virtual async Task<BookDto> CreateAsync(BookCreateDto input)
{
var titles = ObjectMapper.Map<List<BookTranslationCreateDto>, List<BookTranslation>>(input.inputTitles);
var book = await _bookManager.CreateAsync(
input.NoOfPages, input.Dimensions, input.ISBN10, input.ISBN13, input.Price, input.PublishDate,
titles, input.BookLanguageId, input.BookMediaTypeId, input.AuthorIds, input.PublisherIds, input.TagIds, input.FileId
);
return ObjectMapper.Map<Book, BookDto>(book);
}
[UnitOfWork]
public virtual Task HandleEventAsync(APIBookEto eventData)
{
Task.Run(async () =>
{
try
{
var input = ObjectMapper.Map<APIBookEto, BookCreateDto>(eventData);
var titles = ObjectMapper.Map<List<BookTranslationCreateDto>, List<BookTranslation>>(input.inputTitles);
var book = await _bookManager.CreateAsync(
input.NoOfPages, input.Dimensions, input.ISBN10, input.ISBN13, input.Price, input.PublishDate,
titles, input.BookLanguageId, input.BookMediaTypeId, input.AuthorIds, input.PublisherIds, input.TagIds, input.FileId
);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
});
return Task.CompletedTask;
}
}
I can explain the scenario. Here above you can see inside BooksAppService class I have a CreateAsync which is basically inserts data into the database. I have already written all logic inside _bookManager.CreateAsync() function. As you can see I am listening distributed event HandleEventAsync, inside this event function I am executing the same logic which is written in CreateAsync. CreateAsync method is calling through API controller which is perfectly working fine and HandleEventAsync(this is already marked as [UnitOfWork]) is calling through RabbitMq and is throwing the above exceptions.
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable1 parameters)
at Volo.Abp.DependencyInjection.AbpLazyServiceProvider.<>c__DisplayClass12_0.<LazyGetService>b__0()
at Volo.Abp.DependencyInjection.AbpLazyServiceProvider.LazyGetService(Type serviceType)
at Volo.Abp.DependencyInjection.AbpLazyServiceProvider.LazyGetService(Type serviceType, Object defaultValue)
at Volo.Abp.DependencyInjection.AbpLazyServiceProvider.LazyGetService[T](T defaultValue)
at Volo.Abp.Application.Services.ApplicationService.get_GuidGenerator()
at Akadimi.Books.BookAppDistEventService.<CreateAsync>d__8.MoveNext() in D:\Akadimi\Akadimi\aspnet-core\src\Akadimi.Application\Books\BookAppDistEventService.cs:line 79
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Akadimi.Books.BookAppDistEventService.<>c__DisplayClass7_0.<
ABP Framework version: v5.2.0
UI type: Angular
DB provider: EF Core
Tiered (MVC) or Identity Server Separated (Angular): yes
Exception message and stack trace:
Steps to reproduce the issue:"
I have implemented RabbitMq in my application, I am getting an exception inside HandleEventAsync when trying to access application service implemented class method. I tried to implement [UnitOfWork], but still, I am getting exceptions.