The strange is that no exception system log recorded, the application logs could found the request has been received.
On the client, the status is no response from the server, no other response.
If the dotnet process dead or no reponse, then the IIS proxy will throw a message that cannot get response from the upstream server, but in my case it seems upstream dotnet process received the requests, only cannot response result to client.
After clean the solution and rebuild, local debug could hit the break point, but still cannot access some service via WebAPI after deployed to Server
It is running based on ZERO v5.5 (MVC&jQuery version) on windows server 2016
Updated.
when visit a service, suddenly, the server lost response, below logs recorded the request event, before server lost response I am visiting the GetAll method of the Bunk Service, then a Error Redirect action be recorded, but client cannot get any response from server, and other requests all blocked there, event the application received the request, but no response sent to client.
Any logs for the error redirection could be recorded? there is no error or exception system logs on the OS.
INFO 2018-06-24 10:32:31,355 [14 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mydomain.com/api/services/ga/Bunk/GetAll?filter=115&numberFilter=&descriptionFilter=&roomNameFilter=&userNameFilter=&stateIdFilter=&maxCheckInTimeFilter=&minCheckInTimeFilter=&maxCheckOutTimeFilter=&minCheckOutTimeFilter=&nameFilter=&sorting=bunk.number%20asc&skipCount=0&maxResultCount=10 application/json
INFO 2018-06-24 10:32:31,364 [14 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "ga", action = "GetAll", controller = "Bunk"}. Executing action Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application)
INFO 2018-06-24 10:32:31,376 [14 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application) with arguments (Viewtance.GA.Dormitories.Dtos.GetAllBunksInput) - Validation state: Valid
INFO 2018-06-24 10:32:31,470 [14 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 93.4549ms.
INFO 2018-06-24 10:32:31,480 [14 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'.
INFO 2018-06-24 10:32:31,480 [14 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application) in 116.1856ms
INFO 2018-06-24 10:32:31,480 [14 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 125.3737ms 200 application/json; charset=utf-8
INFO 2018-06-24 10:32:46,420 [63 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mydomain.com/api/services/ga/Bunk/GetAll?filter=115&numberFilter=&descriptionFilter=&roomNameFilter=&userNameFilter=&stateIdFilter=&maxCheckInTimeFilter=&minCheckInTimeFilter=&maxCheckOutTimeFilter=&minCheckOutTimeFilter=&nameFilter=&sorting=bunkStateName%20asc&skipCount=0&maxResultCount=10 application/json
INFO 2018-06-24 10:32:46,434 [63 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "ga", action = "GetAll", controller = "Bunk"}. Executing action Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application)
INFO 2018-06-24 10:32:46,447 [63 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application) with arguments (Viewtance.GA.Dormitories.Dtos.GetAllBunksInput) - Validation state: Valid
INFO 2018-06-24 10:32:46,532 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 84.7127ms.
INFO 2018-06-24 10:32:46,541 [19 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'.
INFO 2018-06-24 10:32:46,542 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application) in 107.9084ms
INFO 2018-06-24 10:32:46,542 [19 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 121.5354ms 200 application/json; charset=utf-8
DEBUG 2018-06-24 10:36:02,352 [19 ] Viewtance.SRP.Web.Chat.SignalR.ChatHub - A client is disconnected: eXd406xHH5rdND1JdyuEQA
INFO 2018-06-24 10:36:02,352 [19 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 526880.4817ms 101
INFO 2018-06-24 10:36:26,913 [19 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mydomain.com/api/services/ga/Bunk/GetAll?filter=115&numberFilter=&descriptionFilter=&roomNameFilter=&userNameFilter=&stateIdFilter=&maxCheckInTimeFilter=&minCheckInTimeFilter=&maxCheckOutTimeFilter=&minCheckOutTimeFilter=&nameFilter=&sorting=bunk.number%20asc&skipCount=0&maxResultCount=10 application/json
INFO 2018-06-24 10:36:26,941 [63 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "ga", action = "GetAll", controller = "Bunk"}. Executing action Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application)
INFO 2018-06-24 10:36:26,954 [63 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.GA.Dormitories.BunkAppService.GetAll (Viewtance.GA.Application) with arguments (Viewtance.GA.Dormitories.Dtos.GetAllBunksInput) - Validation state: Valid
INFO 2018-06-24 10:36:50,686 [14 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mydomain.com/lib/@aspnet/signalr/dist/browser/signalr.min.js/signalr.min.js.map
INFO 2018-06-24 10:36:50,694 [14 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 8.0557ms 302
INFO 2018-06-24 10:36:50,732 [37 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mydomain.com/Error?statusCode=404
INFO 2018-06-24 10:36:50,741 [37 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Error", area = ""}. Executing action Viewtance.SRP.Web.Controllers.ErrorController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-24 10:36:50,742 [37 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.ErrorController.Index (Viewtance.SRP.Web.Mvc) with arguments (404) - Validation state: Valid
INFO 2018-06-24 10:36:50,743 [37 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.ErrorController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.ViewResult in 0.0196ms.
INFO 2018-06-24 10:36:50,744 [37 ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executing ViewResult, running view Error404.
INFO 2018-06-24 10:38:24,545 [39 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://mydomain.com/GA/Dormitory/Rooms
INFO 2018-06-24 10:38:24,554 [39 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "GA", action = "Rooms", controller = "Dormitory"}. Executing action Viewtance.SRP.Web.Areas.GA.Controllers.DormitoryController.Rooms (Viewtance.SRP.Web.Mvc)
INFO 2018-06-24 10:38:24,555 [39 ] uthorization.DefaultAuthorizationService - Authorization was successful.
INFO 2018-06-24 10:38:24,570 [39 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Areas.GA.Controllers.DormitoryController.Rooms (Viewtance.SRP.Web.Mvc) - Validation state: Valid
INFO 2018-06-24 10:38:24,570 [39 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Areas.GA.Controllers.DormitoryController.Rooms (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.ViewResult in 0.0352ms.
INFO 2018-06-24 10:38:24,585 [19 ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executing ViewResult, running view Rooms.
Please reference this #5267, it seems we encountered the same issue.
@ismcagdas, yes, the application pool start model is always running, furthermore application pool without recycling.
It is a so urgently confusion issue, I don't kown when the application will not availble, online service is unreliable。
Unfortunately, this is not the real reason, after a new deployment, it happened again. logs record below repeated logs as below:
INFO 2018-06-22 09:12:01,820 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:12:01,829 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:12:01,832 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:12:01,832 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0266ms.
INFO 2018-06-22 09:12:01,844 [10 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:12:01,844 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 15.145ms
INFO 2018-06-22 09:12:01,845 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 24.635ms 302
INFO 2018-06-22 09:18:12,102 [38 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:18:12,109 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:18:12,111 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:18:12,111 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0274ms.
INFO 2018-06-22 09:18:12,122 [38 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:18:12,122 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 12.2954ms
INFO 2018-06-22 09:18:12,122 [38 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 20.5415ms 302
INFO 2018-06-22 09:19:50,981 [25 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:19:50,988 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:19:50,990 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:19:50,990 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0244ms.
INFO 2018-06-22 09:19:51,002 [25 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:19:51,002 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 13.4572ms
INFO 2018-06-22 09:19:51,002 [25 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 21.0892ms 302
INFO 2018-06-22 09:22:22,434 [65 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:22:22,442 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:22:22,444 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:22:22,445 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0276ms.
INFO 2018-06-22 09:22:22,453 [65 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:22:22,453 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 10.8877ms
INFO 2018-06-22 09:22:22,454 [65 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 19.8017ms 302
Yes, I am using the MVC&jQuery edition, I already found this fix and applied, the application is running normally almost one day, I hope this issue is the reason behind and it could be fixed by this approach.
Thanks for your information.
It is a very odd behavior, and confused me recent days. The application will lost response sometimes in a random chance, the client cannot get any response from the server.
First, the Tenancy specified access lost response from the server, then if clean the client cookie, it could access to the Host dashboard, but cannot impersonation to any Tenant, if try to impersonation a Tenant, then it will blocked on the redirect screen.
After several tries, the Host dashboard also will lost response from the server, by this time, all site lost response from the server.
The odd thing is all of these behaviors without exception logs to record, the server level or the application level both are looks work good, and the w3p.exe, application dotnet.exe both are working fine.
During the no response time, the application logs recorded request are received by the application, but cannot return any result to client. It will stop after redirect the route to login action of the account controller.
Every time encountered this behavior only restart the application pool could let the application run normally, no other approach can fix it.
Anybody have this issue too?
It is running under Zero v5.5.0, host on IIS 10 on Windows Server 2012 with SQL Server 2017 as the DB server.
Yes, it generated by RAD tool, as below:
public class StudentsAppService : SchoolAppServiceBase, IStudentsAppService
{
private readonly IRepository<Student, long> _studentRepository;
private readonly IStudentsExcelExporter _studentsExcelExporter;
private readonly IRepository<User,long> _userRepository;
private readonly IRepository<Term,long> _termRepository;
private readonly IRepository<Grade,long> _gradeRepository;
private readonly IRepository<Class,long> _classRepository;
private readonly IRepository<GetInTouchPathway,long> _getInTouchPathwayRepository;
//GA module entity
private readonly IRepository<Room, long> _roomRepository;
private readonly IRepository<Bunk, long> _bunkRepository;
public StudentsAppService(IRepository<Student, long> studentRepository,
IStudentsExcelExporter studentsExcelExporter ,
IRepository<User, long> userRepository,
IRepository<Term, long> termRepository,
IRepository<Grade, long> gradeRepository,
IRepository<Class, long> classRepository,
IRepository<GetInTouchPathway, long> getInTouchPathwayRepository,
IRepository<Room, long> roomRepository,
IRepository<Bunk, long> bunkRepository)
{
_studentRepository = studentRepository;
_studentsExcelExporter = studentsExcelExporter;
_userRepository = userRepository;
_termRepository = termRepository;
_gradeRepository = gradeRepository;
_classRepository = classRepository;
_getInTouchPathwayRepository = getInTouchPathwayRepository;
_roomRepository = roomRepository;
_bunkRepository = bunkRepository;
}
public async Task<PagedResultDto<GetStudentForView>> GetAll(GetAllStudentsInput input)
{
var filteredStudents = _studentRepository.GetAll()
.WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false || e.Name.Contains(input.Filter) || e.Surname.Contains(input.Filter) || e.PersonalName.Contains(input.Filter) || e.Number.Contains(input.Filter) || e.RegisteredResidence.Contains(input.Filter) || e.PhoneNumber.Contains(input.Filter) || e.IDNumber.Contains(input.Filter) || e.WeChat.Contains(input.Filter) || e.QQ.Contains(input.Filter) || e.FatherName.Contains(input.Filter) || e.FatherPhoneNumber.Contains(input.Filter) || e.FatherWeChat.Contains(input.Filter) || e.MotherName.Contains(input.Filter) || e.MotherPhoneNumber.Contains(input.Filter) || e.MotherWeChat.Contains(input.Filter) || e.ProfessionalCourseAppraisal.Contains(input.Filter) || e.LiteracyCourseAppraisal.Contains(input.Filter) || e.CustomAttributes.Contains(input.Filter))
.WhereIf(!string.IsNullOrWhiteSpace(input.NameFilter), e => e.Name.ToLower() == input.NameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.SurnameFilter), e => e.Surname.ToLower() == input.SurnameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PersonalNameFilter), e => e.PersonalName.ToLower() == input.PersonalNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.NumberFilter), e => e.Number.ToLower() == input.NumberFilter.ToLower().Trim())
.WhereIf(input.Sex != null, e => e.Sex == input.Sex)
.WhereIf(input.MinBirthdayFilter != null, e => e.Birthday >= input.MinBirthdayFilter)
.WhereIf(input.MaxBirthdayFilter != null, e => e.Birthday <= input.MaxBirthdayFilter)
.WhereIf(!string.IsNullOrWhiteSpace(input.RegisteredResidenceFilter), e => e.RegisteredResidence.ToLower() == input.RegisteredResidenceFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PhoneNumberFilter), e => e.PhoneNumber.ToLower() == input.PhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.IDNumberFilter), e => e.IDNumber.ToLower() == input.IDNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.WeChatFilter), e => e.WeChat.ToLower() == input.WeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.QQFilter), e => e.QQ.ToLower() == input.QQFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherNameFilter), e => e.FatherName.ToLower() == input.FatherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherPhoneNumberFilter), e => e.FatherPhoneNumber.ToLower() == input.FatherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherWeChatFilter), e => e.FatherWeChat.ToLower() == input.FatherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherNameFilter), e => e.MotherName.ToLower() == input.MotherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherPhoneNumberFilter), e => e.MotherPhoneNumber.ToLower() == input.MotherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherWeChatFilter), e => e.MotherWeChat.ToLower() == input.MotherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ProfessionalCourseAppraisalFilter), e => e.ProfessionalCourseAppraisal.ToLower() == input.ProfessionalCourseAppraisalFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.LiteracyCourseAppraisalFilter), e => e.LiteracyCourseAppraisal.ToLower() == input.LiteracyCourseAppraisalFilter.ToLower().Trim());
var query = (from o in filteredStudents
join o1 in _userRepository.GetAll() on o.UserId equals o1.Id into j1
from s1 in j1.DefaultIfEmpty()
join o2 in _termRepository.GetAll() on o.TermId equals o2.Id into j2
from s2 in j2.DefaultIfEmpty()
join o3 in _gradeRepository.GetAll() on o.GradeId equals o3.Id into j3
from s3 in j3.DefaultIfEmpty()
join o4 in _classRepository.GetAll() on o.ClassId equals o4.Id into j4
from s4 in j4.DefaultIfEmpty()
join o5 in _getInTouchPathwayRepository.GetAll() on o.GetInTouchPathwayId equals o5.Id into j5
from s5 in j5.DefaultIfEmpty()
join o6 in _roomRepository.GetAll() on o.DormitoryRoomId.Value equals o6.Id into j6
from s6 in j6.DefaultIfEmpty()
select new GetStudentForView() { Student = ObjectMapper.Map<StudentDto>(o),
UserName = s1 == null ? "" : s1.Name.ToString(),
TermName = s2 == null ? "" : s2.Name.ToString(),
GradeName = s3 == null ? "" : s3.Name.ToString(),
ClassName = s4 == null ? "" : s4.Name.ToString(),
GetInTouchPathwayName = s5 == null ? "" : s5.Name.ToString(),
SexTypeName = L(string.Format("Enums.{0}.{1}", typeof(SexType).ToString().Split('.', StringSplitOptions.RemoveEmptyEntries).Last(), o.SexType.ToString())),
DormitoryRoomName = s6 == null ? "" : s6.Name.ToString()
})
.WhereIf(!string.IsNullOrWhiteSpace(input.UserNameFilter), e => e.UserName.ToLower() == input.UserNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.TermNameFilter), e => e.TermName.ToLower() == input.TermNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GradeNameFilter), e => e.GradeName.ToLower() == input.GradeNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ClassNameFilter), e => e.ClassName.ToLower() == input.ClassNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GetInTouchPathwayNameFilter), e => e.GetInTouchPathwayName.ToLower() == input.GetInTouchPathwayNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.DormitoryRoomNameFilter), e => e.DormitoryRoomName.ToLower() == input.DormitoryRoomNameFilter.ToLower().Trim());
var totalCount = await query.CountAsync();
var students = await query
.OrderBy(input.Sorting ?? "student.id asc")
.PageBy(input)
.ToListAsync();
return new PagedResultDto<GetStudentForView>(
totalCount,
students
);
}
[AbpAuthorize(AppPermissions.Pages_Students_Edit)]
public async Task<GetStudentForEditOutput> GetStudentForEdit(GetStudentForEditInput input)
{
Student student;
student = await _studentRepository.FirstOrDefaultAsync(input.StudentId);
if (input.UserId > 0)
{
student = await _studentRepository.GetAll()
.Where(e => e.UserId == input.UserId).FirstOrDefaultAsync();
}
var output = new GetStudentForEditOutput {Student = ObjectMapper.Map<CreateOrEditStudentDto>(student)};
var sexTypeValues = from SexType enumValue in Enum.GetValues(typeof(SexType))
select new { Value = Convert.ToInt32(enumValue), Text = L(string.Format("Enums.{0}.{1}", typeof(SexType).ToString().Split('.').Last(), enumValue.ToString())) };
output.SexTypes = sexTypeValues.Select(st => new ComboboxItemDto(st.Value.ToString(), st.Text.ToString()) { IsSelected = output.Student.Sex == st.Value }).ToList();
if (output.Student.UserId != null)
{
var user = await _userRepository.FirstOrDefaultAsync((long)output.Student.UserId);
output.UserName = user.Surname.ToString() + user.Name.ToString();
}
if (output.Student.TermId != null)
{
var term = await _termRepository.FirstOrDefaultAsync((long)output.Student.TermId);
output.TermName = term.Name.ToString();
}
if (output.Student.GradeId != null)
{
var grade = await _gradeRepository.FirstOrDefaultAsync((long)output.Student.GradeId);
output.GradeName = grade.Name.ToString();
}
if (output.Student.ClassId != null)
{
var theClass = await _classRepository.FirstOrDefaultAsync((long)output.Student.ClassId);
output.ClassName = theClass.Name.ToString();
}
if (output.Student.GetInTouchPathwayId != null)
{
var getInTouchPathway = await _getInTouchPathwayRepository.FirstOrDefaultAsync((long)output.Student.GetInTouchPathwayId);
output.GetInTouchPathwayName = getInTouchPathway.Name.ToString();
}
if (output.Student.DormitoryRoomId != null)
{
var dormitoryRoom = await _roomRepository.FirstOrDefaultAsync((long)output.Student.DormitoryRoomId);
output.DormitoryRoomName = dormitoryRoom.Name.ToString();
}
if (output.Student.BunkId != null)
{
var bunk = await _bunkRepository.FirstOrDefaultAsync((long)output.Student.BunkId);
output.BunkName = bunk.Name.ToString();
}
return output;
}
public async Task CreateOrEdit(CreateOrEditStudentDto input)
{
if(input.Id == null){
await Create(input);
}
else{
await Update(input);
}
}
[AbpAuthorize(AppPermissions.Pages_Students_Create)]
private async Task Create(CreateOrEditStudentDto input)
{
var student = ObjectMapper.Map<Student>(input);
if (AbpSession.TenantId != null)
{
student.TenantId = (int?) AbpSession.TenantId;
}
student.StudentGuid = Guid.NewGuid();
await _studentRepository.InsertAsync(student);
}
[AbpAuthorize(AppPermissions.Pages_Students_Edit)]
private async Task Update(CreateOrEditStudentDto input)
{
var student = await _studentRepository.FirstOrDefaultAsync((long)input.Id);
ObjectMapper.Map(input, student);
}
[AbpAuthorize(AppPermissions.Pages_Students_Delete)]
public async Task Delete(EntityDto<long> input)
{
await _studentRepository.DeleteAsync(input.Id);
}
public async Task<FileDto> GetStudentsToExcel(GetAllStudentsForExcelInput input)
{
var filteredStudents = _studentRepository.GetAll()
.WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false || e.Name.Contains(input.Filter) || e.Surname.Contains(input.Filter) || e.PersonalName.Contains(input.Filter) || e.Number.Contains(input.Filter) || e.RegisteredResidence.Contains(input.Filter) || e.PhoneNumber.Contains(input.Filter) || e.IDNumber.Contains(input.Filter) || e.WeChat.Contains(input.Filter) || e.QQ.Contains(input.Filter) || e.FatherName.Contains(input.Filter) || e.FatherPhoneNumber.Contains(input.Filter) || e.FatherWeChat.Contains(input.Filter) || e.MotherName.Contains(input.Filter) || e.MotherPhoneNumber.Contains(input.Filter) || e.MotherWeChat.Contains(input.Filter) || e.ProfessionalCourseAppraisal.Contains(input.Filter) || e.LiteracyCourseAppraisal.Contains(input.Filter) || e.CustomAttributes.Contains(input.Filter))
.WhereIf(!string.IsNullOrWhiteSpace(input.StudentGuidFilter.ToString()), e => e.StudentGuid.ToString() == input.StudentGuidFilter.ToString().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.NameFilter), e => e.Name.ToLower() == input.NameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.SurnameFilter), e => e.Surname.ToLower() == input.SurnameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PersonalNameFilter), e => e.PersonalName.ToLower() == input.PersonalNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.NumberFilter), e => e.Number.ToLower() == input.NumberFilter.ToLower().Trim())
.WhereIf(input.MinSexFilter != null, e => e.Sex >= input.MinSexFilter)
.WhereIf(input.MaxSexFilter != null, e => e.Sex <= input.MaxSexFilter)
.WhereIf(input.MinBirthdayFilter != null, e => e.Birthday >= input.MinBirthdayFilter)
.WhereIf(input.MaxBirthdayFilter != null, e => e.Birthday <= input.MaxBirthdayFilter)
.WhereIf(!string.IsNullOrWhiteSpace(input.RegisteredResidenceFilter), e => e.RegisteredResidence.ToLower() == input.RegisteredResidenceFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PhoneNumberFilter), e => e.PhoneNumber.ToLower() == input.PhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.IDNumberFilter), e => e.IDNumber.ToLower() == input.IDNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.WeChatFilter), e => e.WeChat.ToLower() == input.WeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.QQFilter), e => e.QQ.ToLower() == input.QQFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherNameFilter), e => e.FatherName.ToLower() == input.FatherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherPhoneNumberFilter), e => e.FatherPhoneNumber.ToLower() == input.FatherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherWeChatFilter), e => e.FatherWeChat.ToLower() == input.FatherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherNameFilter), e => e.MotherName.ToLower() == input.MotherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherPhoneNumberFilter), e => e.MotherPhoneNumber.ToLower() == input.MotherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherWeChatFilter), e => e.MotherWeChat.ToLower() == input.MotherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ProfessionalCourseAppraisalFilter), e => e.ProfessionalCourseAppraisal.ToLower() == input.ProfessionalCourseAppraisalFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.LiteracyCourseAppraisalFilter), e => e.LiteracyCourseAppraisal.ToLower() == input.LiteracyCourseAppraisalFilter.ToLower().Trim());
var query = (from o in filteredStudents
join o1 in _userRepository.GetAll() on o.UserId equals o1.Id into j1
from s1 in j1.DefaultIfEmpty()
join o2 in _termRepository.GetAll() on o.TermId equals o2.Id into j2
from s2 in j2.DefaultIfEmpty()
join o3 in _gradeRepository.GetAll() on o.GradeId equals o3.Id into j3
from s3 in j3.DefaultIfEmpty()
join o4 in _classRepository.GetAll() on o.ClassId equals o4.Id into j4
from s4 in j4.DefaultIfEmpty()
join o5 in _getInTouchPathwayRepository.GetAll() on o.GetInTouchPathwayId equals o5.Id into j5
from s5 in j5.DefaultIfEmpty()
join o6 in _roomRepository.GetAll() on o.DormitoryRoomId.Value equals o6.Id into j6
from s6 in j6.DefaultIfEmpty()
select new GetStudentForView() {
Student = ObjectMapper.Map<StudentDto>(o),
UserName = s1 == null ? "" : s1.Name.ToString(),
TermName = s2 == null ? "" : s2.Name.ToString(),
GradeName = s3 == null ? "" : s3.Name.ToString(),
ClassName = s4 == null ? "" : s4.Name.ToString(),
GetInTouchPathwayName = s5 == null ? "" : s5.Name.ToString(),
SexTypeName = L(string.Format("Enums.{0}.{1}", typeof(SexType).ToString().Split('.', StringSplitOptions.RemoveEmptyEntries).Last(), o.SexType.ToString())),
DormitoryRoomName = s6 == null ? "" : s6.Name.ToString()
})
.WhereIf(!string.IsNullOrWhiteSpace(input.UserNameFilter), e => e.UserName.ToLower() == input.UserNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.TermNameFilter), e => e.TermName.ToLower() == input.TermNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GradeNameFilter), e => e.GradeName.ToLower() == input.GradeNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ClassNameFilter), e => e.ClassName.ToLower() == input.ClassNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GetInTouchPathwayNameFilter), e => e.GetInTouchPathwayName.ToLower() == input.GetInTouchPathwayNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.DormitoryRoomNameFilter), e => e.DormitoryRoomName.ToLower() == input.DormitoryRoomNameFilter.ToLower().Trim());
var StudentListDtos = await query.ToListAsync();
return _studentsExcelExporter.ExportToFile(StudentListDtos);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<UserLookupTableDto>> GetAllUserForLookupTable(GetAllForLookupTableInput input)
{
var query = _userRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e => (e.Surname.ToString() + e.Name.ToString()).Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var userList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<UserLookupTableDto>();
foreach(var user in userList){
lookupTableDtoList.Add(new UserLookupTableDto
{
Id = user.Id,
DisplayName = user.Surname + user.Name.ToString()
});
}
return new PagedResultDto<UserLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<TermLookupTableDto>> GetAllTermForLookupTable(GetAllForLookupTableInput input)
{
var query = _termRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var termList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<TermLookupTableDto>();
foreach(var term in termList){
lookupTableDtoList.Add(new TermLookupTableDto
{
Id = term.Id,
DisplayName = term.Name.ToString()
});
}
return new PagedResultDto<TermLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<GradeLookupTableDto>> GetAllGradeForLookupTable(GetAllForLookupTableInput input)
{
var query = _gradeRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var gradeList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<GradeLookupTableDto>();
foreach(var grade in gradeList){
lookupTableDtoList.Add(new GradeLookupTableDto
{
Id = grade.Id,
DisplayName = grade.Name.ToString()
});
}
return new PagedResultDto<GradeLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<ClassLookupTableDto>> GetAllClassForLookupTable(GetAllForLookupTableInput input)
{
var query = _classRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var classList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<ClassLookupTableDto>();
foreach(var theClass in classList){
lookupTableDtoList.Add(new ClassLookupTableDto
{
Id = theClass.Id,
DisplayName = theClass.Name.ToString()
});
}
return new PagedResultDto<ClassLookupTableDto>(
totalCount,
lookupTableDtoList
);
} [AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<GetInTouchPathwayLookupTableDto>> GetAllGetInTouchPathwayForLookupTable(GetAllForLookupTableInput input)
{
var query = _getInTouchPathwayRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var getInTouchPathwayList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<GetInTouchPathwayLookupTableDto>();
foreach(var getInTouchPathway in getInTouchPathwayList){
lookupTableDtoList.Add(new GetInTouchPathwayLookupTableDto
{
Id = getInTouchPathway.Id,
DisplayName = getInTouchPathway.Name.ToString()
});
}
return new PagedResultDto<GetInTouchPathwayLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
}
Zero version 5.5.0 The same application published via MVC project and Host project, some of WebAPI services, the same WebAPI service could access from MVC site, but cannot access from Host project.
As below logs recorded, the GetAll method of the Belonging service works fine, but the GetAll method of the Student service not response to the requester.
INFO 2018-06-18 11:23:34,860 [20 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:22742/api/services/school/Belongings/GetAll application/json
INFO 2018-06-18 11:23:34,913 [20 ] uthentication.JwtBearer.JwtBearerHandler - Successfully validated the token.
INFO 2018-06-18 11:23:35,028 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "school", action = "GetAll", controller = "Belongings"}. Executing action Viewtance.School.Belongings.BelongingsAppService.GetAll (Viewtance.School.Application)
INFO 2018-06-18 11:23:36,619 [20 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.School.Belongings.BelongingsAppService.GetAll (Viewtance.School.Application) with arguments (Viewtance.School.Belongings.Dtos.GetAllBelongingsInput) - Validation state: Valid
INFO 2018-06-18 11:23:38,214 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.School.Belongings.BelongingsAppService.GetAll (Viewtance.School.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 1591.8809ms.
INFO 2018-06-18 11:23:38,346 [19 ] .Mvc.Infrastructure.ObjectResultExecutor - Executing ObjectResult, writing value of type 'Abp.Web.Models.AjaxResponse'.
INFO 2018-06-18 11:23:38,353 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.School.Belongings.BelongingsAppService.GetAll (Viewtance.School.Application) in 3322.0408ms
INFO 2018-06-18 11:23:38,361 [19 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 3497.0352ms 200 application/json; charset=utf-8
INFO 2018-06-18 11:27:13,362 [47 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:22742/api/services/school/Students/GetAll application/json
INFO 2018-06-18 11:27:13,366 [47 ] uthentication.JwtBearer.JwtBearerHandler - Successfully validated the token.
INFO 2018-06-18 11:27:13,382 [47 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {area = "school", action = "GetAll", controller = "Students"}. Executing action Viewtance.School.Students.StudentsAppService.GetAll (Viewtance.School.Application)
INFO 2018-06-18 11:27:15,019 [47 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.School.Students.StudentsAppService.GetAll (Viewtance.School.Application) with arguments (Viewtance.School.Students.Dtos.GetAllStudentsInput) - Validation state: Valid
If insert a break point to track the code, the no response method will step out the break point, the client blocked on the no response state.
Anybody also encountered this issue?