Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startup-scripts don't seem to work for Ubuntu 16.04 image #342

Closed
vopani opened this issue Sep 25, 2016 · 17 comments
Closed

startup-scripts don't seem to work for Ubuntu 16.04 image #342

vopani opened this issue Sep 25, 2016 · 17 comments

Comments

@vopani
Copy link

vopani commented Sep 25, 2016

Version: ubuntu-1604-xenial-v20160922
Tried using the startup-script option as well as via Google Storage.

@illfelder
Copy link
Contributor

/cc @OddBloke

Thanks for the report - this appears to be an issue with the latest image release. As we work with Canonical to fix the issue, I'd suggest using the ubuntu-1604-xenial-v20160921 image.

@illfelder
Copy link
Contributor

The problematic image is rolled back so the issue should be (mostly) resolved.

@TomTasche
Copy link

Hey there,

Unfortunately this doesn't seem to be resolved (or I'm experiencing a similar issue). Here's my bug report on the old / other bug tracker: https://code.google.com/p/google-compute-engine/issues/detail?id=426

PS: I was able to reproduce the problem today. @illfelder

@TomTasche
Copy link

Oh I see, the Cloud Console says "amd64 xenial image built on 2016-09-21" so that obviously does not include the fix you mentioned above. When are images expected to be updated in Cloud Console?

@illfelder
Copy link
Contributor

/cc @gaughen

@illfelder
Copy link
Contributor

The existing image that you are running should work out of the box, however the issue presents after updating packages. Canonical is pushing package updates to close off the issue (followed by new images).

@Kamforka
Copy link

Any update on this issue? One and a half year passed and it's still not working for me.

@OddBloke
Copy link

Hi @Kamforka, could you give us an example gcloud command line that reproduces the problem you are seeing?

@Kamforka
Copy link

Hi @OddBloke this is my way of doing things:

I've set up a metadata for my Ubuntu 16.04 LTS compute engine instance as:
key: startup-script
value:

#! /bin/bash
su my_user -c gcsfuse my-storage /home/Storage/

I restarted the VM, did ssh into in through the web console. And noted that the mount command specified in the startup wasn't executed.

Also tried to execute the startup-script manually like:
sudo google_metadata_script_runner --script-type startup
But nothing happened.

@Kamforka
Copy link

@OddBloke
Well it was my mistake, I used a different image that is not Ubuntu 16.04, but Debian stretch.
On the Ubuntu image it works fine, although I still don't understand why it does not on Debian?

@OddBloke
Copy link

@Kamforka I'd suggest opening a separate issue for that. :-)

@illfelder I think we can close this out now?

@illfelder
Copy link
Contributor

When running manually, add the debug flag to your command so you can see the script output:
sudo google_metadata_script_runner --script-type=startup --debug

@flaviokr
Copy link

flaviokr commented Feb 7, 2018

We are facing the same problem. We upgraded from Ubuntu 14.04 to Ubuntu 16.04 (with apt-get dist-upgrade command) and startup scripts stopped working after the upgrade.

When we run manually the 14.04 version: sudo /usr/share/google/run-startup-scripts it works

When we run manually the 16.04 version: sudo google_metadata_script_runner --script-type=startup --debug it returns sudo: google_metadata_script_runner: command not found

How to solve this?

@OddBloke
Copy link

OddBloke commented Feb 7, 2018

@flaviokr Could you run dpkg -l | grep '\(gce\|goog\)' and paste the output here, please?

@flaviokr
Copy link

flaviokr commented Feb 8, 2018

ii  gce-cloud-config                      1.2.2-0ubuntu2~14.10.0                      amd64        Configuration for Ubuntu on Google Compute Engine
ii  gce-daemon                            1.2.2-0ubuntu2~14.10.0                      amd64        Google daemon for configuring instances
ii  gce-imagebundle                       1.2.2-0ubuntu2~14.10.0                      amd64        Bundle image for use on Google Compute Engine
ii  gce-startup-scripts                   1.2.2-0ubuntu2~14.10.0                      amd64        Google Compute Engine Start-up scripts
ii  google-cloud-sdk                      0.9.37-20141125060859+dsf1-0ubuntu1~14.10.0 all          Google Cloud SDK for interacting with Google Cloud services.
ii  google-compute-engine-oslogin         20171129+dfsg1-0ubuntu1~16.04.0             amd64        Google Compute Engine OS Login

We installed google-compute-engine-oslogin recently while trying to fix this issue.

@illfelder
Copy link
Contributor

It looks like your VM is running a very old version of the guest environment. It's possible you're running into an issue we fixed in a guest environment change that you haven't yet updated to. We have instructions on how to update here: https://cloud.google.com/compute/docs/instances/linux-guest-environment. Let me know if you run into any problems.

@jessequinn
Copy link

problem exists with ubuntu18

dpkg -l | grep '\(gce\|goog\)'
ii  google-compute-engine              20210629.00-0ubuntu1~18.04.0              all          Google Compute Engine guest environment.
ii  google-compute-engine-oslogin      20210728.00-0ubuntu1~18.04.0              amd64        Google Compute Engine OS Login
ii  google-guest-agent                 20210629.00-0ubuntu1~18.04.1              amd64        Google Compute Engine Guest Agent
ii  google-osconfig-agent              20210608.1-0ubuntu1~18.04.1               amd64        Google OS Config Agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants