Unhandled NULL exception when activating

I’ve been struggling with this issue for nigh on a week now. When trying to activate Unity from the command-line on Ubuntu (have tried 12.04, 14.04, 16.04) with a valid serial I receive an unhandled NULL exception at the activation step.
I am using the following command (and variations on) to launch:

Which results in the following log:

Replacing the -force-opengl option with -nographics results in the same.

I have also tried starting up an xvfb instance with a VNC (this is all on a headless server) and activating using the GUI, however immediately after successfully logging in with the GUI, the whole process crashes.

Strangely, in the past I have been able to use the GUI to activate a personal license successfully, but trying to do so now results in the GUI crashing after logging in.

Edit: When trying to activate using the GUI, the log file looks like so:

Hm, it looks like some of the frames are getting inlined and reducing the usefulness of the callstack.
Do you have all of the following environment variables set in the environment where Unity’s running: USER, LC_MESSAGES, LC_ALL, LANG
Can you run with strace and post a log?

Hey Tak, thanks for the response. I don’t have any of those environment vars set at all, but interestingly if I run with sudo then I can login & activate a serial. It just has the unfortunate side-effect of every file being touched by Unity then being owned by root.
I’ve attached the strace output as well as the Unity log from a failed attempt.

2943850–217922–unitylogs.zip (598 KB)

Maybe related to CreateDirectory '/home/builduser/.cache/unity3d' failed from your earlier log?

In any case, it seems likely that part of the issue is not having USER set.
We’ll fix this use case, but it seems likely that other stuff will go wrong if it’s not set.