Activities of "Marten"

Details in github https://github.com/abpframework/abp/issues/10161

Hi

Using version 4.4.2/Angular/MongoDB

Saving an entity with a bool field throws error.

Additional details in github issue: https://github.com/abpframework/abp/issues/10155

Regards, Mårten

Ok, so it seems the issue is that the test classes get generated by ABP Suite without being added to the test collection.

After decorating the generated test-classes with [Collection(MyProjectTestConsts.CollectionDefinitionName)] all tests can be run together.

Is this by design or a bug in the code generator?

Tried some more and the tests seem to work at first when a new project is generated but start failing after an entity has been generated.

Version 4.4.2 Angular MongoDB

I am having problems running the tests in my project using MongoDB, the tests work fine when I run them one at a time, but when I try to run all tests I get connection problems:

System.Net.Sockets.SocketException: 'No connection could be made because the target machine actively refused it.'

System.TimeoutException
  HResult=0x80131505
  Message=A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Direct", Type : "ReplicaSet", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "127.0.0.1:54282" }", EndPoint: "127.0.0.1:54282", ReasonChanged: "NotSpecified", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.
 ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.ConnectAsync(Socket socket, EndPoint endPoint, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.CreateStreamAsync(EndPoint endPoint, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.ServerMonitor.InitializeConnectionAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.ServerMonitor.HeartbeatAsync(CancellationToken cancellationToken)", LastHeartbeatTimestamp: "2021-09-23T12:15:05.9886939Z", LastUpdateTimestamp: "2021-09-23T12:15:05.9891692Z" }] }.
  Source=MongoDB.Driver.Core
  StackTrace:
   at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)

   System.TimeoutException
  HResult=0x80131505
  Message=Timed out connecting to 127.0.0.1:54282. Timeout was 00:00:30.
  Source=MongoDB.Driver.Core
  StackTrace:
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.<ConnectAsync>d__7.MoveNext()

  This exception was originally thrown at this call stack:
    MongoDB.Driver.Core.Connections.TcpStreamFactory.ConnectAsync(System.Net.Sockets.Socket, System.Net.EndPoint, System.Threading.CancellationToken)

I have generated a first entity using ABP Suite which gives multiple tests for CRUD operations, and running all these tests at the same time cause the error.

Should this be working out of the box or is there some additional configuration needed?

Possibly related to https://github.com/Mongo2Go/Mongo2Go/issues/98

Hi

I have the same question basically, I did a test as mentioned above adding a nested object on the entity directly in the repository and it worked fine saving the nested data in mongodb.

Are there any plans on adding support for nested objects in ABP Suite?

That was it, thank you!

I have hangfire implemented in a separate module and was calling UseHangfireDashboard in OnApplicationInitialization which when I debugged to test got called after OnApplicationInitialization of the ApiHost-module.

I moved UseHangfireDashboardto OnPostApplicationInitialization and everything works fine.

Thanks again for fast replies and help!

Hi,

I copied AbpHangfireAuthorizationFilter from the PR and added a dependency from my module where I have implemented hangfire to AbpAuthorizationAbstractionsModule but the IsLoggedIn-check in that authorization filter also returns false.

The way I log in is navigating on host domain to /account/login which then redirects to /swagger and then I type /hangfire in the url field, is that the correct way to authenticate that should be working?

I am using Abp 4.4 Angular

I have added hangfire with the dashboard according to docs and added a specific permission in the abp permission system that I want to use to control access to the dashboard.

I have also implemented a custom IDashboardAuthorizationFilter according to Hangfire docs that get called when I try to open the dashboard and seem to be working fine (I get a 401 unauthorized).

My issue is that I am not sure how to authenticate and check the permission. I have tried logging in on host by opening https://localhost:44389/account/login and then seen that HttpContext.User.IsAuthenticated()=True in the HomeController, but when navigating to https://localhost:44389/hangfire after that context.GetHttpContext().User.Identity.IsAuthenticated=False in my IDashboardAuthorizationFilter.

Any thoughts on what I am doing wrong here is really appreciated.

Showing 1 to 9 of 9 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07