An error in ProcessFeedEntries() occurred #3

Closed
alvaromartinezmajado opened this Issue Nov 22, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@alvaromartinezmajado

Hi,

I'm getting the following error. My Google Sites is hosted on a Google Apps domain. When choosing settings in the Google Developers Console, the Google Sites Data API wasn't listed, so I've skipped the step as stated in the documentation.

Thank you for sharing your project :)

Traceback (most recent call last):
  File "<my folder>/google-sites-backup//backup.py", line 720, in Run
    id_to_pub_href = self.ProcessFeedEntries(destdir) # HTTP transfers
  File "<my folder>/google-sites-backup//backup.py", line 523, in ProcessFeedEntries
    (feed, raw_html_content, raw_entry_by_full_id) = self.GetContentFeed()
  File "<my folder>/google-sites-backup//backup.py", line 471, in GetContentFeed
    (feed, cached_xml) = self._GetContentFeed_Google(next_link_href)
  File "<my folder>/google-sites-backup//backup.py", line 442, in _GetContentFeed_Google
    next_link_href
  File "<my folder>/gdata-python-client/src/gdata/sites/client.py", line 155, in get_content_feed
    auth_token=auth_token, **kwargs)
  File "<my folder>/gdata-python-client/src/gdata/client.py", line 640, in get_feed
    **kwargs)
  File "<my folder>/gdata-python-client/src/gdata/client.py", line 319, in request
    RequestError)
RequestError: Server responded with: 400, <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 400 (Bad Request)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>400.</b> <ins>That’s an error.</ins>
  <p>Your client has issued a malformed or illegal request.  <ins>That’s all we know.</ins>


An error in ProcessFeedEntries() occurred.
Dumping the current entry:
None
@famzah

This comment has been minimized.

Show comment
Hide comment
@famzah

famzah Nov 23, 2015

Owner

Hi,

It seems that there is some general problem with Sites hosted on a Google Apps domain. And I never tested this configuration.

Is it possible that you create a new test Site on your Google Apps domain, and then grant me full privileges, so that I can recreate the problem myself easily?

Owner

famzah commented Nov 23, 2015

Hi,

It seems that there is some general problem with Sites hosted on a Google Apps domain. And I never tested this configuration.

Is it possible that you create a new test Site on your Google Apps domain, and then grant me full privileges, so that I can recreate the problem myself easily?

@alvaromartinezmajado

This comment has been minimized.

Show comment
Hide comment
@alvaromartinezmajado

alvaromartinezmajado Nov 23, 2015

Hi,

Done. I've mailed you the details to the e-mail address that you share on your blog.

Thank you

Hi,

Done. I've mailed you the details to the e-mail address that you share on your blog.

Thank you

@famzah

This comment has been minimized.

Show comment
Hide comment
@famzah

famzah Nov 24, 2015

Owner

Hi,

Fortunately, it works on my side. So at least it's not some general bug with Google Apps :)

I'll describe how I managed to get it working, so that you can confirm the steps on your side:

  • Prerequisites:
    • Your Google Apps domain is "alvaro.cat" and you created the Google Site named "debugging". The full URL address to this site is https://sites.google.com/a/alvaro.cat/debugging/
    • My Google Apps domain is "famzah.net" and you granted to my user permissions to the site "debugging".
  • I created Google API credentials for my user at the Google Apps domain "famzah.net", since I was using it for the first time for API operations:
    • Before I could do that I had to enable the "Google Developers Console" in the "Apps" section of Google Admin for my user @ my Google Apps domain "famzah.net": http://stackoverflow.com/questions/32019132/unable-to-create-a-new-project-in-the-google-developer-console
    • Then I followed the instructions to create an OAuth 2,0 credentials (https://github.com/famzah/google-sites-backup). The screens for Google Apps users are slightly different but the idea is the same:
      • Create a new project.
      • Click "Enable and manage APIs" at the big box "Use Google APIs // Enable APIs, create credentials, and track your usage".
      • I couldn't find the "Google Sites Data" API in the list, so I skipped the step.
      • Click "Credentials" in the left menu (API Manager), etc.
    • Write down the "Client ID" and "Client secret".

Here is what I typed at the console, in order to back up the Google Site:

$ google-sites-backup.git/run.sh gdata-python-client.git/ google-sites-backup.git/

#---

If your Site is hosted on a Google Apps domain, enter it (e.g. example.com); otherwise leave empty: alvaro.cat
Site name: debugging
Session file to store the auth token [leave empty to skip]: 
Please enter your OAuth 2.0 Client ID which identifies your app: 123456789012-abcdefghijklmnop1234567890abcdef.apps.googleusercontent.com
Please enter your OAuth 2.0 Client secret which you share with the OAuth provider: AbCdEfG1234567890AbCdEfG

Visit the following URL in your browser to authorize this app:

https://accounts.google.com/o/oauth2/auth?access_type=offline&redirect_uri=...SOME_VERY_LONG_URL...

What is the verification code? 4/abc1DE-ABC-DE-1ABCDEFghijklmnop1234567890_a
Directory to store the backup: test-backup

#---

Fetching & saving the content feed of 'debugging' ...
Entry ID: https://sites.google.com/feeds/content/alvaro.cat/debugging/3292256782291253281
test-backup/a/alvaro.cat/debugging/home.html (Entity - webpage)
test-backup/a/alvaro.cat/debugging/__meta/home.txt (Meta - webpage)
Next page to fetch from the API? No.

Moving list entries into their parent pages...

All done.

#---

I've tested the Non-interactive execution, too:

OAUTH2_ID='123456789012-abcdefghijklmnop1234567890abcdef.apps.googleusercontent.com'
OAUTH2_SECRET='AbCdEfG1234567890AbCdEfG'
WIKI='debugging'
ROOT_BACKUP_DIR='test-backup'
DOMAIN='alvaro.cat'

google-sites-backup.git/run.sh gdata-python-client.git/ google-sites-backup.git/ \
--client_id="$OAUTH2_ID" \
--client_secret="$OAUTH2_SECRET" \
--domain="$DOMAIN" \
--site="$WIKI" \
--session_file='' \
--backup_dir="$ROOT_BACKUP_DIR"
Owner

famzah commented Nov 24, 2015

Hi,

Fortunately, it works on my side. So at least it's not some general bug with Google Apps :)

I'll describe how I managed to get it working, so that you can confirm the steps on your side:

  • Prerequisites:
    • Your Google Apps domain is "alvaro.cat" and you created the Google Site named "debugging". The full URL address to this site is https://sites.google.com/a/alvaro.cat/debugging/
    • My Google Apps domain is "famzah.net" and you granted to my user permissions to the site "debugging".
  • I created Google API credentials for my user at the Google Apps domain "famzah.net", since I was using it for the first time for API operations:
    • Before I could do that I had to enable the "Google Developers Console" in the "Apps" section of Google Admin for my user @ my Google Apps domain "famzah.net": http://stackoverflow.com/questions/32019132/unable-to-create-a-new-project-in-the-google-developer-console
    • Then I followed the instructions to create an OAuth 2,0 credentials (https://github.com/famzah/google-sites-backup). The screens for Google Apps users are slightly different but the idea is the same:
      • Create a new project.
      • Click "Enable and manage APIs" at the big box "Use Google APIs // Enable APIs, create credentials, and track your usage".
      • I couldn't find the "Google Sites Data" API in the list, so I skipped the step.
      • Click "Credentials" in the left menu (API Manager), etc.
    • Write down the "Client ID" and "Client secret".

Here is what I typed at the console, in order to back up the Google Site:

$ google-sites-backup.git/run.sh gdata-python-client.git/ google-sites-backup.git/

#---

If your Site is hosted on a Google Apps domain, enter it (e.g. example.com); otherwise leave empty: alvaro.cat
Site name: debugging
Session file to store the auth token [leave empty to skip]: 
Please enter your OAuth 2.0 Client ID which identifies your app: 123456789012-abcdefghijklmnop1234567890abcdef.apps.googleusercontent.com
Please enter your OAuth 2.0 Client secret which you share with the OAuth provider: AbCdEfG1234567890AbCdEfG

Visit the following URL in your browser to authorize this app:

https://accounts.google.com/o/oauth2/auth?access_type=offline&redirect_uri=...SOME_VERY_LONG_URL...

What is the verification code? 4/abc1DE-ABC-DE-1ABCDEFghijklmnop1234567890_a
Directory to store the backup: test-backup

#---

Fetching & saving the content feed of 'debugging' ...
Entry ID: https://sites.google.com/feeds/content/alvaro.cat/debugging/3292256782291253281
test-backup/a/alvaro.cat/debugging/home.html (Entity - webpage)
test-backup/a/alvaro.cat/debugging/__meta/home.txt (Meta - webpage)
Next page to fetch from the API? No.

Moving list entries into their parent pages...

All done.

#---

I've tested the Non-interactive execution, too:

OAUTH2_ID='123456789012-abcdefghijklmnop1234567890abcdef.apps.googleusercontent.com'
OAUTH2_SECRET='AbCdEfG1234567890AbCdEfG'
WIKI='debugging'
ROOT_BACKUP_DIR='test-backup'
DOMAIN='alvaro.cat'

google-sites-backup.git/run.sh gdata-python-client.git/ google-sites-backup.git/ \
--client_id="$OAUTH2_ID" \
--client_secret="$OAUTH2_SECRET" \
--domain="$DOMAIN" \
--site="$WIKI" \
--session_file='' \
--backup_dir="$ROOT_BACKUP_DIR"
@alvaromartinezmajado

This comment has been minimized.

Show comment
Hide comment
@alvaromartinezmajado

alvaromartinezmajado Nov 29, 2015

Hi @famzah, thank you for your assistance. I'm still unable to get it to work, but I'm doing some research.

Hi @famzah, thank you for your assistance. I'm still unable to get it to work, but I'm doing some research.

@alvaromartinezmajado

This comment has been minimized.

Show comment
Hide comment
@alvaromartinezmajado

alvaromartinezmajado Nov 29, 2015

Ok, so for further reference, "site name" should be the exact substring in the URL, something like: "test-site" for "https://sites.google.com/a/alvaro.cat/ test-site /".

It's not an arbitrary name for your records, nor the main title, or anything like that.

Thank you @famzah for your help

Ok, so for further reference, "site name" should be the exact substring in the URL, something like: "test-site" for "https://sites.google.com/a/alvaro.cat/ test-site /".

It's not an arbitrary name for your records, nor the main title, or anything like that.

Thank you @famzah for your help

@famzah famzah closed this Nov 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment