How to change Google Cloud app system time? - google-cloud-platform

I am trying to change the server time for my Google Cloud app. It is showing the time as 4:52 AM in my app when it should be showing 9:52 PM.
I have tried to SSH into the app and change it via
$ dpkg-reconfigure tzdata, but it doesn't seem to have persisted. How can I achieve this?

The Google Cloud App Engine runtime's Time Zone environment variable is set to UTC, and can't be changed.You can change the time zone of a datetime in memory

Related

Customised Google Cloudshell image does not launch

Customised Google Cloud Shell image fails to launch, error is 'Cloud Shell is experiencing some issues provisioning a VM to you. Please try again in a few minutes'. Repeated attempts to launch also fail.
I created a custom Google Cloudshell Image with an Ansible lab environment and setup tutorial. When this was tested approximately 10 days ago, it seemed to work as expected. Setup was performed using the following guide
Project is hosted with the 'Open in Google Cloud Shell' button here
For convenience, this is the launch button as a link
The customised Cloud Shell image is hosted at gcr.io/diveintoansible/diveintoansible-lab-gcp-cloudshell
I've checked the permissions and these appear to be open to the public as desired.
Any advice on resolving this, greatly appreciated.
This usually happens because the base image is out of date. If your image worked a few weeks ago, you probably just need to rebuild it.

Google cloud shell so that the process continues when logged out

I use shell or vps from google cloud, and every time I want to run a process in this shelll when I exit the process in the shell also stops or dies.
I have used the SCREEN and TMUX commands, when I get out of the shell for 20 minutes the process shuts down by itself.
can I get the solution from the masters?
To answer shortly to your question: it's not possible.
With more detail, you need to understand what is Cloud Shell: it's a micro VM that google start freely for you. You have a quota per week and the VM is restarted at least every 12h
Non-interactive usage: Cloud Shell is intended for interactive use only. Non-interactive sessions will be ended automatically after a warning. Note that Cloud Shell sessions are capped at 12 hours, after which sessions are automatically terminated. You can use a new session immediately after.
When you aren't in interaction with the Cloud Shell console, it stops automatically after 20 minutes. Why? To save resource and save money (on Google side), because you don't pay this computing resource.
You have more detail on Cloud Shell environment limitations in the documentation
Anyway, if you want to run a batch job, on a small VM like Cloud Shell, you can use the Free tier compute engine instance for this. (choose correctly the region, else you will pay!)

Jenkins Poll SCM is showing next time to check is the following day

I'm attempting to run jenkins on an AWS EC2 instance. I have updated the EC2 instance to the correct timezone and I've updated the JAVA_ARGS in /etc/default/jenkins to have the same timezone as my EC2 instance. I'm not even sure if timezone is the problem. But in my Poll SCM section when I update the settings it shows the next time the job will run is the following day. Here is a screenshot take at 7/25/2020 9:35 my local time. As you can see it shows that it won't run until 7/26/2020 at 1:34.
I also just now noticed that while it's building (triggered manually) it shows the date as tomorrow
But once it's done building and I refresh the jenkins page it shows the right date
EDIT
Following are screenshots of my user's timezone in the jenkins GUI and the timezone shown in the systemInfo page of the jenkins server

Error when trying to connect to a Cloud SQL instance using the Cloud Shell

I've had a Cloud SQL instance for about a year now.
I always accessed it the same way:
I would go to my project on the Cloud Console.
Click on the Cloud Shell icon at the top right (a small right pointing arrow).
A black shell screen would pop up where I would type
gcloud sql connect <my instance> --user=root.
Enter my password.
Now, all of a sudden, I am getting an error message saying:
There was no instance found at projects//instances/ or you are not authorized to connect to it.
I am the owner of the project, and also have Admin rights to the Cloud SQL instance. The project and instance are still there, and my app that accesses the data stored in the instances' database is working fine - therefore I know the database is also present, otherwise my app wouldn't work.
I didn't touch or change anything in the Cloud SQL instance. Suddenly, I simply can't access my database using the exact same procedure I have been using almost every day over the past year now.
I am able to access the database using a local Python script on my laptop and the Cloud SQL Proxy, but I would like to access it from the Cloud Shell again.
Any ideas on what could the problem be?
gcloud components update - update all of your installed components to the latest version
gcloud init - reinitialize gcloud shell. It performs the following setup steps:
Authorizes gcloud and other SDK tools to access Google Cloud Platform using your user account credentials, or from an account of your choosing whose credentials are already available.
It seems like there was a problem with the GCP Cloud Shell (even though there was no mention of it on the GCP error tracking page). When I logged back in today and followed the same above process everything worked well.
Looks like GCP Cloud Shell could occasionally go rouge and start producing errors. Word of advice, don't panic when this happens (like I did) and start resetting, rebooting and messing up things. Just wait a day and check back again.

How to adjust the time settings on an AWS instance?

When I type date on my AWS Linux instance, I get the time as 4 hours earlier than it is in my personal timezone.
I'd like to change this, since some logs I'm writing are showing times in the future, but I don't know how.
I can only find this page on the topic (other Google results appear very old), and the advice it gives is to modify the clock file...which I don't see existing at /etc/sysconfig/clock.
I am running Ubuntu.
Does anyone know how to adjust the time settings on an AWS instance?
on ubuntu, you can run dpkg-reconfigure tzdata and select your region/country to change your time zone settings