This might be unrelated but what I found useful is to disable health checks in autoscaling groups. This allows the script to run even it fails and get more details on why the script failed. For me it is sometimes the file path not setup correctly in the app.
Hope it helps.