You are viewing limited content. For full access, please sign in.

Question

Question

Configuring the Notification Service for real-time updates on the Tasks page

asked on December 1, 2020

I am reviewing the guide found here, for providing real-time updates on the Tasks page.

https://www.laserfiche.com/support/webhelp/Laserfiche/10/en-US/administration/#../Subsystems/Forms/Content/Notification-Service.htm

Not using SSL for the time being

The instructions are:
the services run as the Local System machine account. Use the Windows Services snap-in to change this default setting.

Then it on Step 4, it never says what account we are changing to, other than Local System.

Click the Log On tab, and use the This account option to specify a different user account that the service should use to log on. When you are finished, click OK.

What is the account that the service should use to log on, if not Local System?

0 0

Replies

replied on December 1, 2020

You should run the Laserfiche Notification Hub & Master services as Local System.

Those are optional instructions for if you want to change the default service identity (Local System) to something like your own AD service account. You shouldn't change the default in nearly all cases as it makes the configuration significantly more complex and error prone. I'll put in a documentation update request to make it clearer that changing the default identity isn't required.

Do note that if Forms is using HTTPS, the Forms Notification Service must use HTTPS as well, else browsers will block all the unencrypted Forms Notification Service HTTP calls as "mixed content".

See: What Is “Mixed Content,” and Why Is Chrome Blocking It?

0 0
replied on December 1, 2020

Ok, I am currently keeping everything on an HTTP non-secure connection for testing.

So this means there really is no extra configuration left to do outside of the Config Page. I really don't have many options in the config page, except entering the machine name. I don't know what else to do to allow forms to talk to it's notification service.

I wish the logic in the notification service was instead in the routing service. Forms has no issues talking to the routing service ever, but in every installation, it can't talk to the notification service.

0 0
replied on December 2, 2020

You might try some of the troubleshooting/diagnostic steps I describe in this related Answers post, especially about looking at the browser calls in DevTools.

I agree that it would be more convenient if the notification service were self-contained within the routing service. I've certainly spent my fair share of time troubleshooting Forms Notification issues. It's something we've discussed internally before and unfortunately isn't a small or low-effort change.

0 0
replied on December 3, 2020

I pulled up the dev tools and it does show a 500 error

{"errors":[{"status":500,"code":"NotificationServerConnectionDown","message":"A connection to the notification server could not be made. Notifications and real-time updates have been disabled. [LFF8100-NotificationServerConnectionDown]"}]}

Then in the LFNotificationService event log it gives this error, indicating that the problem is Forms not using the correct URI format. I think this is why the notification service does not work in any environment, regardless of how simple the environment is. Forms needs to use the correct URI.

Invalid URI: The format of the URI could not be determined.

Stack Trace:
Caught exception: System.UriFormatException
Message: Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at Microsoft.AspNet.SignalR.Client.Http.DefaultHttpClient.Get(String url, Action`1 prepareRequest, Boolean isLongRunning)
   at Microsoft.AspNet.SignalR.Client.Transports.TransportHelper.GetNegotiationResponse(IHttpClient httpClient, IConnection connection, String connectionData)
   at Microsoft.AspNet.SignalR.Client.Transports.AutoTransport.GetNegotiateResponse(IConnection connection, String connectionData)
   at Microsoft.AspNet.SignalR.Client.Transports.AutoTransport.Negotiate(IConnection connection, String connectionData)
   at Microsoft.AspNet.SignalR.Client.Connection.Negotiate(IClientTransport transport)
   at Microsoft.AspNet.SignalR.Client.Connection.Start(IClientTransport transport)
   at Laserfiche.SignalR.Client.LFHubProxy.Connect()
   at Laserfiche.SignalR.Client.Factories.LFHubProxyFactory.Create(HubEndPoint hubEndPoint)
   at Laserfiche.PushNotificationService.Master.Services.RegisterService.Register(PushServiceRegisterRequest registerData)
   at Laserfiche.PushNotificationService.Master.PushNotificationService.Register(PushServiceRegisterRequest registerData)
   at SyncInvokeRegister(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

0 0
replied on December 3, 2020 Show version history

Most of the time we see that error it's due to a typo, invisible character, or similar issue in the Laserfiche Notification Hub URL configuration. See attached screenshot.

You can see from the stack trace that the error is coming from Microsoft's System.Uri library, so there's something in the string getting passed it can't parse.

That's something we should probably validate when you try saving the value in FormsConfig instead of at runtime though, so I'll file an enhancement request for a better validation check.

LaserficheNotificationHubURLConfig.png
0 0
replied on December 3, 2020

I am going to paste what is in the configuration in here so you can verify there is no invalid characters.

I do not think this is a configuration mistake, this is a built in problem with Forms.

//LAPTOP-HBSSS28P:8181

0 0
replied on December 3, 2020

I copy/pasted that into my own Forms 10.4.4.444 instance, added a hosts file entry to point LAPTOP-HBSSS28P to the local IP, and do not receive the Uri error.

I can however easily trigger the Uri error by adding extra slashes at the beginning like "////LAPTOP-HBSSS28P:8181"

Try opening up the file at "C:\Program Files (x86)\Laserfiche\Laserfiche Notification\Service\Laserfiche.PushNotificationService.Master.Host.exe.config" and checking the HubAddress value under the <appSettings> node. That what the FormsConfig Laserfiche Notification Hub URL sets.

Set the HubAddress value to "http://LAPTOP-HBSSS28P:8181" directly within that file (replace it with a clean string even if it already looks the same), save, restart the three Forms/Notification services, and see if it works or if you get a different error.

0 0
replied on December 3, 2020

I found the problem, it is a problem with the latest installers. I just uninstalled and did a fresh install to confirm. Also this is not noted anywhere in the documentation, or I would rather have it right on the config page instead of buried in the documentation.

In the config app there is a Laserfiche tab, this tab ALSO has a notification service configuration (which is strange being that there is an entire section for notification service)

It looks like this and it is auto configured by the installer.

Test connection works showing that nothing is wrong with the connection.

However, simply changing the word localhost to the machine name fixed the URI error and now I see the count of tasks in my inbox. This one actually doesn't even have the //machine: requirement notated.

I was just trying random things and decided to replace this with the machine name, I can't understand how anyone else in the world has figured this out. How is this service working for anyone?

0 0
replied on December 3, 2020

The "Notification Service" tab is for configuring the Notification Master Service (which needs the Laserfiche Notification Hub URL). The Hub URL is where Forms actually sends end users to get notifications.

The "Laserfiche" tab is for configuring the Forms Routing Service and telling it where to find the Notification Master Service and Workflow.

In nearly all cases, people run the Forms Routing Service and Notification Master Service on the same server, so the default value of "localhost:8268" works. I have never had to change it across dozens and dozens of Forms installations. Your machine name resolves down to localhost either way, and I promise that using the machine name instead is not itself what fixed things.

After digging deeper, I suspect you ran into a variant of this published Known Issue:

  • After upgrading from earlier versions of Forms to 10.4 and newer, a restart of the Notification Master Service is required in order to receive notifications. (170398)

When I looked up the bug, it noted the issue is related to the config files being modified after starting the service during the install and throws a backend error message of "Invalid URI: The format of the URI could not be determined." I suspect you changing the FormConfig option triggered the necessary restart.

Most Laserfiche applications leave some of their config files behind during uninstall so a user reinstalling does not always have to reconfigure everything. If you are really going for a clean install, make sure to delete both the application's Program Files and ProgramData folders after uninstalling first to actually get a blank slate. For some applications, you may need to delete certain application-specific registry keys left behind as well.

 

0 0
replied on December 3, 2020

Ok, I switched it back to localhost and restarted master service, then the routing service (because you have to to save the setting). Now it works again.

But it couldn't be that the services were never restarted since I upgraded last, I restarted the whole laptop just 3 times today, not to mention all the times I have restarted the laptop since I started this post. The laptop is shut it down when I am not using it.

Now I am confused, I am back to the original non-working configuration and yet it is working. There must be something else that causes the URI to be invalid, other than not restarting your server after an install.

0 0
replied on December 9, 2020

Yes I can confirm that I just got lucky with my Dev environment. The URI is still invalid when I try to do this in a production environment.

It seems to be you must restart the service in some specific order, but I have tried guessing at every order and it is a no go, I don't know what the restart pattern is to get the correct URI.

It certainly is not as simple as restarting the Master service because in both situations I tried that. But it must be related to restarting services in some way, because there is no configuration options regarding the URI, only the config asking to enter the machine name.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.