New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 628432 link

Starred by 10 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

User cannot login b/c Google API keys missing

Project Member Reported by cernekee@chromium.org, Jul 14 2016

Issue description

At the top of the OOBE screen I see:

"You will not be able to add users because Google API keys are missing. See http://www.chromium.org/developers/how-tos/api-keys for details."

I cannot log into the Chromebook.  The error is "Sorry, your email or password could not be verified."

This is an internal local veyron_minnie-cheets Chromium OS build from a freshly synced tree (~3:30pm today, CHROMEOS_RELEASE_VERSION=8588.0.2016_07_14_1615).  I have never seen this problem before, and I don't recall ever setting up API keys.
 
The keys are missing probably because your browser is Chromium. Using Chrome browser will likely fix the issue.

Chromium used to work.  Did something change?

I deployed a freshly synced+built Chrome browser and that seemed to work (although a bunch of other unrelated stuff seems to be broken).

I searched my email for "api keys" but only found the trouble report from emaxx, no announcement or instructions. :-(
Cc: kaznacheev@chromium.org
Labels: -Pri-0 Pri-2
I don't know of any change to API keys, BUT if you're doing a Chromium build you should be following the steps at the URL in the description to make sure your build includes them.

kaznacheev@ is this what you ran into as well?

This is very much NOT a Pri-0
I've run into this on a kevin and a gnawty with the chrome pre-builts.
> This is very much NOT a Pri-0

If you're trying to develop something for Chrome OS and you need to log into the laptop to work on it, this is a blocker.

(I was lucky enough to have a Chrome source tree lying around so it only cost me about an hour, but a lot of others aren't working on Chrome and would not be able to do the same.)

Could you please revert whichever change caused the error?

Thanks!
I have the same problem, do not remember ever having configured the API keys for multiple ChromeOS checkouts that I have been using over a long time.

FWIW the instruction at https://sites.google.com/a/google.com/chromeos/resources/engineering/how-to-build is saying this:

The external instructions don't mention the fact that there are keys available in the internal repositories.  If you are building from an internal checkout of ChromeOS,  valid keys will be automatically supplied to Chrome and Chromium builds.  Chrome builds will use the Official Chrome keys.  If you build Chromium from an internal ChromeOS checkout it will use a different set of keys that also have a high quota for access to the API services.   If you have to suppress these keys,  you can,  but it's not worth bothering everyone with how here.  Look in the ebuild for chrome, and the workings of entering the chroot.



Comment 7 by emaxx@chromium.org, Jul 15 2016

Cc: emaxx@chromium.org
The internal instructions say "How to Build Chrome OS". But, according to the comments above, it seems that there's still a choice between having Chrome OS with Chromium and Chrome OS with Chrome, is that correct?
And if yes, is there some easy way to get the latter one - or the only intended solution is to build with CHROME_ORIGIN=LOCAL_SOURCE pointing to local internal Chrome checkout?

Comment 8 by emaxx@chromium.org, Jul 15 2016

Also just wanted to point out to the fact that with the previous versions (at least with R52 branches) just following the steps described at the internal building documentation worked fine - i.e. no special steps for building Chrome or acquiring the API keys were required.

Comment 9 Deleted

Labels: -Pri-0 Pri-1
Actually, this is at least Pri-1, as this effects all Chrome OS developers.
Something changed this week, and we can no longer log in to locally built images when following the traditional instructions:
  ./build_packages --board=X && ./build_image --board=X tes

Owner: steve...@chromium.org
I just created a new cros_sdk on R53, and sync'ed and built an image.
This image works (I can log in as any user).

Here was the chromeos-chrome invocation, notice USE=-chrome_internal, so the resulting image has "chromium" not chrome. Also notice "-gn":

(cr) (release-R53-8530.B/(8628edf...)) djkurtz@djkurtz1 ~/trunk/src/scripts $ emerge-elm -pvq chromeos-chrome
[ebuild   R   ] chromeos-base/chromeos-chrome-53.0.2785.15_rc-r1 to /build/elm/ USE="accessibility autotest build_tests buildcheck chrome_debug chrome_remoting cups evdev_gestures fonts gold hardfp highdpi nacl neon opengles ozone runhooks v4l2_codec xkbcommon -X -afdo_use -app_shell -asan -chrome_debug_tests -chrome_internal -chrome_media -clang -component_build -envoy -gn -internal_gles_conform -internal_khronos_glcts -mojo -opengl -v4lplugin -vaapi -verbose -vtable_verify" OZONE_PLATFORM="gbm -caca -cast -egltest {-test}" OZONE_PLATFORM_DEFAULT="gbm -caca -cast -egltest {-test}" 

This is what it looks like on ToT (R54):

[ebuild   R   ] chromeos-base/chromeos-chrome-54.0.2792.0_rc-r1 to /build/elm/ USE="accessibility autotest build_tests buildcheck chrome_debug chrome_remoting cups evdev_gestures fonts gn gold hardfp highdpi nacl neon opengles ozone runhooks v4l2_codec xkbcommon -X -afdo_use -app_shell -asan -chrome_debug_tests -chrome_internal -chrome_media -clang -component_build -envoy -internal_gles_conform -internal_khronos_glcts -mojo -opengl -v4lplugin -vaapi -verbose -vtable_verify" OZONE_PLATFORM="gbm -caca -cast -egltest {-test}" OZONE_PLATFORM_DEFAULT="gbm -caca -cast -egltest {-test}" 

The biggest difference I can spot, is that R54 now has USE="gn".

This was changed quite recently in chromiumos-overlay/chromeos-base/chromeos-chrome:

commit cc18dcb156c4730acfcf384decb2fe568722d351
Author: Steven Bennetts <stevenjb@chromium.org>
Date:   Fri Jun 24 15:52:09 2016 -0700

    Use GN by default for chromeos-chrome


Hmm, I'll try to build an image again on R54 with USE="-gn" build_packages ...
Summary: User cannot login b/c Google API keys missing (was: Google API keys missing)
Yup. Confirmed.  After waiting 90 minutes, I can boot & log in as a user if I locally build an image with:

USE="-gn" ./build_packages --board=elm && ./build_image --board=elm --noenable_rootfs_verification test

Note: there is still an outside chance that the difference is that I am locally building Chrome now, rather than installing a chromeos-chrome pre-built.  But that seems unlikely, since in theory my locally build USE="gn" chromeos-chrome should match the prebuilt.
Cc: achuith@chromium.org
Here is the section in the chromeos-chrome ebuild that sets up the API keys:

        # Get the credentials to fake home directory so that the version of chromium                                                                                                                                                                           
        # we build can access Google services. First, check for Chrome credentials.                                                                                                                                                                            
        if [[ ! -d google_apis/internal ]]; then                                                                                                                                                                                                               
                # Then look for ChromeOS supplied credentials.                                                                                                                                                                                                 
                local PRIVATE_OVERLAYS_DIR=/home/${WHOAMI}/trunk/src/private-overlays                                                                                                                                                                          
                local GAPI_CONFIG_FILE=${PRIVATE_OVERLAYS_DIR}/chromeos-overlay/googleapikeys                                                                                                                                                                  
                # RE to match the allowed names.                                                                                                                                                                                                               
                local NRE="('google_(api_key|default_client_(id|secret))')"                                                                                                                                                                                    
                # RE to match whitespace.                                                                                                                                                                                                                      
                local WS="[[:space:]]*"                                                                                                                                                                                                                        
                # RE to match allowed values.                                                                                                                                                                                                                  
                local CRE="('[^\\\\']*')"                                                                                                                                                                                                                      
                # And combining them into one RE for describing the lines                                                                                                                                                                                      
                # we want to allow.                                                                                                                                                                                                                            
                local TRE="^${WS}${NRE}${WS}[:=]${WS}${CRE}.*"                                                                                                                                                                                                 
                if [[ ! -f "${GAPI_CONFIG_FILE}" ]]; then                                                                                                                                                                                                      
                        # Then developer credentials.                                                                                                                                                                                                          
                        GAPI_CONFIG_FILE=/home/${WHOAMI}/.googleapikeys                                                                                                                                                                                        
                fi                                                                                                                                                                                                                                             
                if [[ -f "${GAPI_CONFIG_FILE}" ]]; then                                                                                                                                                                                                        
                        mkdir "${HOME}"/.gyp                                                                                                                                                                                                                   
                        cat <<-EOF >"${HOME}/.gyp/include.gypi"                                                                                                                                                                                                
                        {                                                                                                                                                                                                                                      
                                'variables': {                                                                                                                                                                                                                 
                                $(sed -nr -e "/^${TRE}/{s//\1: \4,/;p;}" \                                                                                                                                                                                     
                                        "${GAPI_CONFIG_FILE}")                                                                                                                                                                                                 
                                }                                                                                                                                                                                                                              
                        }                                                                                                                                                                                                                                      
                        EOF                                                                                                                                                                                                                                    
                fi                                                                                                                                                                                                                                             
        fi                    

As you can see, it only puts them in the ${HOME}/.gyp directory.  Presumably gn isn't checking the files in that directory for the keys.  Unfortunately, http://www.chromium.org/developers/how-tos/api-keys doesn't specify how to provide the keys for a gn build.  If someone can point me to a doc or page that describes how to do that, I can upload a CL with the changes to the ebuild.

Or if no one knows, we can revert the CL that made the gn build the default until we figure out how to properly pull in the keys.
Cc: steve...@chromium.org ihf@chromium.org
Owner: achuith@chromium.org
-> achuit@, I don't know anything about this code.
+ ihf@

Cc: petermayo@chromium.org
Ah, I see, in later comments there is a suspicion that this is GN related.

Switching back to GYP is not an option, support for GYP is being rapidly deprecated.

chirantan@ - I'm not sure if anyone knows how to provide the api keys for a gn build. I certainly do not.

I can try to investigate later today.

+petermayo@ who added (or moved) this code according to git blame.

Comment 17 by ihf@chromium.org, Jul 15 2016

You either can build from public Chromium sources, but then have to create API keys and put them in /etc/chrome_dev.conf as environmental variables.

Or it used to be that building from internal Chromium sources (you have a src-internal) would bake some API keys into the binary and you didn't have to deal with your own API keys.

It sounds like switching to GN broke the later magic.
Looks like we can do it by setting them as gn args: https://cs.chromium.org/chromium/src/google_apis/BUILD.gn

I'm currently locally testing a CL that does this.  I will upload it this afternoon once I'm sure it's working. 
chirantan@ - that sounds great, thanks! I am happy to review any change.
Cc: davidri...@chromium.org
Owner: chirantan@chromium.org
Status: Started (was: Available)
CL up for review here: https://chromium-review.googlesource.com/c/361001
Project Member

Comment 22 by bugdroid1@chromium.org, Jul 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/65facb9b3f91be9d225403c97c7ed233e86fcae8

commit 65facb9b3f91be9d225403c97c7ed233e86fcae8
Author: Chirantan Ekbote <chirantan@chromium.org>
Date: Fri Jul 15 21:27:41 2016

Include API keys in chrome gn build

The chrome ebuild only set the API keys for the gyp build of chrome.
Add them for the gn build as well.

BUG= chromium:628432 
TEST=emerge and deploy chromeos-chrome on samus and see that it doesn't
     show an 'API keys are missing' dialog anymore

Change-Id: I064641a2e43c0d1ba70265bca61abf736b7396de
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/361001
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>

[modify] https://crrev.com/65facb9b3f91be9d225403c97c7ed233e86fcae8/chromeos-base/chromeos-chrome/chromeos-chrome-9999.ebuild

Status: Fixed (was: Started)
Status: Verified (was: Fixed)

Sign in to add a comment