'syntax error near unexpected token `newline' on GCP

I am getting this error

install-logging-agent.sh: line 2: syntax error near unexpected token newline' install-logging-agent.sh: line 2: '

on this command curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh sudo bash install-logging-agent.sh



Solution 1:[1]

I use the same installation script for a server I set up back in 2018 and ran into the same issue today. The installation method we are using appears to have been deprecated by Google because trying to load the URL https://dl.google.com/cloudagents/install-logging-agent.sh returns a 404 error. This was still working for me two weeks ago, so it was something recent.

The solution would be to update your installation method to follow the current documentation at https://cloud.google.com/logging/docs/agent/logging/installation (posted by @Kolban in a comment)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FaithoftheFallen