The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Dropbox Version 81.4.195 (September 18, 2019) Not Working With AlwaysUp For Some Customers

Dropbox is experiencing issues

The most recent release of Dropbox — Stable Build 81.4.195, posted the morning of September 18 — may not work properly as a Windows Service with AlwaysUp.

We are actively investigating. So far, the problem appears to be related to Session 0 — the background desktop hosting Windows Services.

When Dropbox starts in Session 0, some customers report that this error prompt stops the action:

Dropbox OpenGL Error

If OK is pressed, Dropbox simply exits — without synchronizing any files.

Is there a workaround?

Yes. Please see the update from 9/25 (below) for a potential workaround. To date, it has worked for several customers.

Dropbox says to make sure that your display drivers are up to date. This has resolved the problem for some customers. Please let Dropbox know if it doesn’t work for you.

Beyond that, there are a couple other workarounds but neither is a long term solution.

If you start Dropbox in the current session (by selecting Start “Dropbox” in this session from the Application menu), Dropbox will start and your files will be synchronized. However, once you log off, Dropbox will return to Session 0 and it will cease to function again.

Another option is to run Dropbox outside of AlwaysUp, normally on your desktop. Of course, you will have to remain logged in, which is less than ideal.

Please check in the “Updates” section below for additional workarounds as they are developed.

When will this be fixed?

We’re not sure when Dropbox will fix the problem.

They seem to create new desktop client builds regularly so we have our fingers crossed that they deliver a resolution very soon.

Please let Dropbox know that you are affected

We encourage you to “nudge” the Dropbox team into action by:

The more we speak up, the better the chance of a quick fix.

We need your help!

First, can you let us know if you are experiencing trouble with the latest Dropbox? Please be sure to answer the following questions:

  • What version of Windows are you running?

  • Do you see the “OpenGL” error message when you switch to Session 0? That operation is available from the Tools menu in AlwaysUp.

  • Is your computer a virtual machine? If so, what is the host? (VirtualBox, Hyper-V, VMWare, etc.)

Second, can we access your system remotely to troubleshoot? We have been unable to reproduce the problem on our systems, and that has been an obstacle to us developing a solution/workaround.

Your help will be appreciated!

Updates

September 18 @ 5:38 PM Pacific: Eric Sakariasen from Connetic has come up with a clever workaround:

  I found a way to work around this issue, at least in my environment,

We have Dropbox running with separate creds (a service account) I go to the cached installer for 81.4.195, in my case its:

C:\Program Files (x86)\Dropbox\Update\Download\{CC46080E-4C33-4981-859A-BBA2F780F31E}\81.4.195

I deny all access to the executable via NTFS permissions for that account. Then install the older 80.4.127 over the top of the current install (it kills the running version automagically). This seems to break the ability for the updater to do its magic so it will skip this version.

We can only hope the next version is up and running with a fix, if not, rinse and repeat.

This has worked for at least 3 of our customers running Dropbox.

September 18 @ 9:20 PM Pacific: So far we have thoroughly tested Dropbox version version 81.4.195 running in Session 0 on the following operating systems:

  • Windows Server 2019
  • Windows Server 2012 R2
  • Windows 10 (Build 1903)

None have exhibited the problem.

Here is the basic test we perform using two computers linked to the same Dropbox account:

  1. Copy a new file into machine’s A’s Dropbox folder
  2. Check that the file shows up on dropbox.com
  3. Check that the file shows up in machine B’s Dropbox folder

We will continue to test other versions of Windows over the next few days.

September 19 @ 6:15 AM Pacific: The Dropbox support team suggests that the problem may be with old display drivers.

Perform the steps outlined in this post to make sure that your PC is up-to-date.

September 19 @ 10 PM Pacific: Dropbox posted Beta Build 82.3.133 earlier today.

We’re not sure if it fixes the problems running in Session 0 (Dropbox doesn’t post a changelog) but it may be worth a shot. Please try it let us know if it works for you or not.

September 25 @ 10:30 PM Pacific: Dropbox forum user Wilson7777 has proposed a workaround:

  For those scratching their heads trying to resolve this OpenGL issue running the latest version of Dropbox + AlwaysUp I have successfully resolved this issue by following these steps:

1. In the Windows start menu enter the search term “environment variables” and select “Edit the system environment variables”

2. In the dialog that comes up click “Environment Variables” then click “New” in the system variables section.

3. In the dialog that comes up enter variable name = ‘QT_OPENGL’ (without the quotes) and variable value = ‘software’ (without the quotes)

Click “OK” then “OK” then “OK” to close the system properties dialogue.

Restart Dropbox within AlwaysUp and you should find the OpenGL issues are resolved if you view through session 0 and Dropbox will be synchronising your files fine.

Please try it and let us know if it works for you!

September 26 @ 7:30 AM Pacific: Customer Seth Ruppert from IMT has reported that the 9/25 fix has resolved the issue on his installations.

And other reports of success are trickling in, so setting the QT_OPENGL system environment variable to software seems to be working!

September 27 @ 12:30 AM Pacific: The fix from 9/25 is working well so we have documented our recommended workaround in this post. Enjoy!

Posted in AlwaysUp | Tagged , , , , | 11 Comments

Q&A: How do I Fix “The service did not start due to a logon failure”?

Q&A - Logon failed
  I setup AlwaysUp to run JRiver Media Center as a Windows Service but it’s simply not working. I reboot the server every week and every time AlwaysUp says it can’t log on. These errors come up, over and over:

AlwaysUp logon failure errors

Help!

— Anonymous

Hi — sorry to hear that the service isn’t starting for you!

From the logs you sent, the key error appears to be this one:

The service did not start due to a logon failure

Windows is saying that it cannot authenticate your account (the one you specified on the Logon tab in AlwaysUp) so it cannot start the service.

The failure is probably due to one of three problems. Answer the following questions to find a solution.

Has your Windows password expired/changed?

If you recently set a new password on your Windows account, the service may be stuck using the old one.

To update the service’s password:

  1. Edit your JRiver service in AlwaysUp

  2. Switch to the Logon tab

  3. Enter your new password:

    Enter your new password
  4. Save your settings.

Reboot your PC and see if JRiver starts automatically. If not, read on to keep troubleshooting.

Have you specified a domain account on the AlwaysUp Logon tab?

If your service is running in a domain account, it’s possible that the service is starting too soon — before the primary domain controller is ready to accept requests.

Indeed, this can easily happen when your computer is the slow-starting domain controller!

The fix is to delay the start of the JRiver service, to allow the domain controller enough time to launch and initialize. To do so:

  1. Edit your JRiver service in AlwaysUp

  2. Set the Start the application field to Automatically, but shortly after the computer boots:

    Set JRiver service to start delayed
  3. Save your settings.

Reboot and see if that does the trick!

Is your Active Directory Group Policy overwriting the Local Policy setting for the “Log on as a service” right?

This last scenario applies if your system uses Active Directory and you have specified a domain account on the AlwaysUp Logon tab.

Your Windows account may be losing the right to run as a service when an incomplete group policy overwrites the local policy. Basically, your account is “out of sync” with the Active Directory server.

The solution is to modify the domain group policy, as outlined in this blog post.

Still experiencing “logon failure” errors?

If you are still seeing the error, something strange is definitely going on with your setup.

Please get in touch to schedule a remote session, where we can troubleshoot your misbehaving service. We’ll do our best to have you up and running soon!

Posted in AlwaysUp | Tagged , , , , | Leave a comment

How to Run a Python Script Every Hour, On the Hour

How to Run a Python Script Every Hour

Python is fast becoming the world’s most popular coding language. It’s no surprise that more and more administrators are turning to the simple, efficient, and ubiquitous platform for a variety of day-to-day tasks.

One question that frequently comes up on Internet forums deals with scheduling:

  How do I schedule my Python script to run every hour on my Windows computer?

The Windows Task Scheduler seems like it should do the job, but unfortunately it falls short because it has no ability to restart an application at a fixed time. You would have to set up 24 tasks, one for each hour of the day. That’s too much busy work.

You could also create a batch file that runs the script in an infinite loop and launch the batch file with Task Scheduler. That would be easier, but the lack of a fixed schedule means that you wouldn’t know the time when the script would be run. And with zero monitoring and error reporting, you would be left in the dark if the script somehow stopped running — for example, if someone accidentally terminated it. Not a very robust approach.

Instead, we recommend using AlwaysUp. Simply setup your Python script to run as a background Windows Service, then configure AlwaysUp to launch your script each hour on the hour. Here’s how to do that.

1. Install your Python script as a Windows Service with AlwaysUp

First, follow our step-by-step tutorial showing how to run any Python script as a Windows Service with AlwaysUp.

Python running as a Windows Service

Your Python script will be configured to run once per day but don’t worry — we’ll adjust that in the next section.

2. Restart your Python script every hour, on the hour

Instead of running only once per day, let’s run your script hourly. To make that change:

  1. Edit your Python script in AlwaysUp.

  2. Switch to the Restart tab.

  3. Check the Not immediately and the On the next hour options:

    Restart Python hourly
  4. Click the Save button to record your changes.

3. Minimize logging as your script stops and restarts in the background

By default, AlwaysUp will record detailed information (in the Windows Event Logs) whenever the application it is monitoring starts and stops. This is fine for programs designed to operate 24/7, but that logging can be overwhelming for a script that starts and stops frequently.

To reduce the writing to the Event Logs:

  1. Edit your Python script in AlwaysUp.

  2. Switch to the Restart tab.

  3. Check the Minimize event logging as the application stops & starts option:

    Minimize Python Service Logging
  4. Click the Save button to record your changes.

And that’s it. From now on, your Python script will run predictably — every hour, on the hour.

Please be sure to get in touch if you have any questions about running your script as a service (or anything else).

Posted in AlwaysUp | Tagged , , , | Leave a comment

Support for Windows 7 and Windows Server 2008 Ending in January 2020

Windows Server 2008 R2 End of Life

After more than a decade in the trenches, Windows 7 and Windows Server 2008 R2 will no longer be supported. Microsoft will stop issuing updates for those operating systems on Tuesday January 14, 2020.

I’m still running Windows 7/Server 2008: What does this mean for me?

After the deadline, your computer will no longer receive Windows updates/patches. This is probably fine for new features and capabilities (who needs those anyway?), but it is potentially lethal for safety and security.

This is because any serious security flaw discovered after January 2020 will not be fixed. Attackers will have all the time they need to break into your computer.

We recommend upgrading ASAP — especially if you are working in a commercial environment. Why put you and your company at risk for a ransomware or other cyber-attack?

Will your software (AlwaysUp, Service Protector, etc.) continue to work on Windows 7/2008?

Yes. For now, all our current software will continue to work with the soon-to-be-retired versions of Windows. We will not be disabling those operating systems in any versions of our Windows Services software that you can download today.

However, at some point we will drop support for 7/2008. For example, AlwaysUp version 13 (expected in 2021) may no longer run on 7/2008. Of course, you will be able to stick with version 12 (or earlier) for as long as you like.

Will you provide support if I’m running Windows 7/2008?

Yes — up to a point. We’ll happily investigate problems on those systems, but realize that our hands will be tied if the flaw is due to a problem in the underlying (now obsolete) operating system.

Additional information/resources

As usual, please get in touch if you have any questions or need help working with our software after the deadline has passed.

Posted in Windows | Tagged , , , | Leave a comment

Q&A: How Do I See the Output/Traceback From my Python Windows Service?

Q&A - Python Output
  We’re using AlwaysUp to run a Python program as a service. Do you have any recommendations about logging?

Ideally I would see the output of the python program as if it were run in command line, to see the traceback if there is an error. For example:

    Traceback (most recent call last):
    File "", line 1, in 
    NameError: name 'r' is not defined

— Liam

Hi Liam. I see your problem. It’s important to know when Python runs into a problem, but errors can be difficult to spot when the service’s console — alive and well in the isolated Session 0 — isn’t visible on your desktop.

You have a couple of options:

1. Capture the output of your Python program in a text file

AlwaysUp can capture Python’s command line output to a file of your choosing. That option is available on the Extras tab:

Capture Output from the Extras tab

Check the Capture output to this log file box and enter the full path to a (new) text file.

If your script generates lots of text, you may want to prevent the file from growing too large. Check the Automatically trim box and specify the maximum size in megabytes. When the file grows to the maximum size, the oldest 10% will be discarded to make room for new entries. Be sure to tune the max size so that you don’t lose useful data.

With those settings in place, your Python service will write all console/traceback output to the file. Both the standard output and standard error streams will be captured.

Open the file to see what’s going on with your script. Or even better, use the free Tail for Win32 to “track” the file. New lines will appear in real-time — just if you were looking at the Python console.

To confirm our advice, we ran a Python script with a deliberate error (borrowed from this page) and captured the output. Here is the result (with WinTail monitoring the output file):

Python script: Traceback output

It works!

2. Run your Python script in the current session, where you will see the console

If you don’t want to configure logging — or you just want to see the console temporarily while debugging a problem — you can instruct AlwaysUp to run the Python console on your desktop.

Simply select Application > Restart in this session and AlwaysUp will temporarily stop Python and “re-parent” it onto your screen:

Restart Python program in this session

Your program will run visibly while you are logged in. When you logout, AlwaysUp will automatically return your application to the background (i.e. Session 0).

One final bit of advice…

We recommend that you do your best to thoroughly debug your Python script before running it as a set-it-and-forget-it Windows Service. Dynamic languages like Python need extra attention in that area.

The fewer surprises in production the better, right?

Posted in AlwaysUp | Tagged , , , , , | Leave a comment