[App server] java.lang.NullPointerException

Hi @daviesian

For Clone 1, I download the codes from GIT and run it using app server, specifying the dep apps in the configuration file. Then on browser it shows the Assert failed: (-edn-roundtrip-ok? val val-str) error.

For Clone2, It had the same error as Clone 1. Then I removed the dep apps from the settings. Those dep apps are not needed in the cut down version. Then the Assert failed error disappears. After that if I revert to the version that includes the dep apps in the settings, the error doesn’t come back.

Thank you @huarong ! Please can you share the configuration file you are using (with secrets redacted, and privately if you wish)?

If I run Clone1 like this:

$ anvil-app-server --app Clone1 --dep-id 34NNNE33ILRYUDQ5=MS_Dates --dep-id F4L65G2BB5RPZJJJ=Tokens --dep-id VH7A25FOBTPJTRZT=AnvilAugment --dep-id WZEKUAUGVCFPQQFX=popover --dep-id ZCMX6EO73R4UACTH=Tabulator1 --secret <SECRETS GO HERE>

And then visit http://localhost:3030, the app loads just fine with no errors. Please can you confirm that this is not the case for you?

Thanks @daviesian

When I use the command line as above, which is essentially same as my configuration file, it runs with no error.

After that I try to run it with the configuration file and the error disappears.

Then I download Clone 1 to a new folder, and run the new download using configuration file, the error is back.

The difference between the configuration file and the command line is that the configuration file includes auto-migration and a up-link key.

The configuration file also includes some https settings. I sent the file over via email.

@daviesian

Then I try to run the original app using command line instead of configuration file. I successfully get rid of the Assert failed error.

The app asked me to login via SSO through Microsoft Integration as expected. However, the microsoft integration is not working. In the window that I should choose my microsoft account, it has the following error message…

We could not find an app that matched your request.

You may have copied the URL for this app incorrectly, or this app may have been deleted or withdrawn. You may also have been logged out, in which case refreshing this page might help.

Thanks for sending over the configuration file! Obviously this includes an HTTPS origin for your domain, so it’s a little tricky to test. Do you get the error if you launch Clone 1 using the configuration file, but hosting on the default origin of http://localhost:3030?

Yes, I see the same Assert failed error when I launch Clone 1 using the configuration file but hosting on the default origin.

I see a work around is to run it on command line. Then run it using the configuration file has no problem. It would be good if you can find the root cause though.

After I work around the Assert failed error, another error I got is the microsoft SSO seems not working. I notice the error message in app server is

[ERROR anvil.runtime.server] Error in Microsoft auth callback
java.lang.UnsupportedOperationException: Attempted to decrypt an encrypted value (‘microsoft-service/application-secret’) from the anvil.works hosted platform. This should be specified in the App Server configuration instead.

Is it a change in App Server v1.12? I didn’t have the problem in v1.10. How shall I configure mircrosoft SSO in v1.12? Thanks!

Hi @huarong

Thanks for all these details. I believe we have now identified the issue with using a configuration file, and we’re working on a fix.

The Microsoft SSO error message actually contains the solution - you need to provide the credentials for the Microsoft Service on the command line (or in the config file) for the App Server. These credentials are now encrypted in your app source code (as they always should have been!), so the App Server is (correctly!) unable to read them.

I’ll let you know as soon as we have released a fix for the failed assert.

@daviesian

Thank you very much. The Microsoft SSO works now.

1 Like

Hi @huarong,

Thanks so much for your patience and for your help in debugging this issue. We have now released v1.12.3 of the App Server, which should no longer throw an assertion error when using a configuration file with dependencies. Please give it a try and let me know how you get on!

1 Like

@daviesian v1.12.3 works well. Thanks!

1 Like

Would it be possible to release v1.12.3 code changes on GitHub?

1 Like

it’s good to hear that the issue is solved in 1.12.3, but anyway it’s not possible to update it because of the bug HTTP Endpoints not working · Issue #92 · anvil-works/anvil-runtime · GitHub. Do you have any timeline for the fix?
@daviesian