Coder Social home page Coder Social logo

Comments (18)

kencanak avatar kencanak commented on May 28, 2024 1

Hey @leonstafford , I am encountering the same issue with version 6.5.1

This was the error

API response code 200
API response body {"data":{"repository":{"object":null}}}
Creating public/xxx/index.html in GitHub
API response code 422
API response body {"message":"Invalid request.\n\n"sha" wasn't supplied.","documentation_url":"https://developer.github.com/v3/repos/contents/#update-a-file"}
BAD RESPONSE STATUS FROM API (422)
Deployment: error encountered
Exception: BAD RESPONSE STATUS FROM API (422)

from static-html-output.

dmeagor avatar dmeagor commented on May 28, 2024 1

Working on this. Delayed due to a different/unrelated issue with our server. I'll send over the log details as soon as I can.

from static-html-output.

dmeagor avatar dmeagor commented on May 28, 2024

tried again with a .5 sec delay but same error.

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

Thanks @dmeagor. Working on a "Debugging mode" when exporting for easier debugging, but could you please try the following in Advanced Tab:

  • set Deployment Batch Size to 1

If that alone doesn't allow the export to complete, please try:

  • set API Request Delay to 0.1

Increase the delay if still not completing.

I'm not yet convinced with the change I've done from the old GitHub deploy method (single-commit) to this one, in order to allow for incremental deploys. The advantage of this one is that if you can complete an export, subsequent ones will be much faster.

from static-html-output.

dmeagor avatar dmeagor commented on May 28, 2024

Deployment batch size is already set to 1 and api request delay is 0.5

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

Hi @dmeagor, sorry, I read it properly now and see the:

BAD RESPONSE STATUS (404): http://PLACEHOLDER.wpsho/

That may be unrelated to the API issue, but is worth looking into. What it means is that the plugin has failed to rewrite a local link on the original site properly.

It uses this PLACEHOLDER.wpsho first, as a way to normalize all URLs for later being more easily able to rewrite to the Destination URL.

When I implement the Debugging Mode option, we'll be able to see each action/request logged in order, so in this case, we're failing on a particular file, we'll know exactly which one it failed on.

I'm groping in the dark a bit until then, but this hints that it may be trying to send an empty file to the GitHub API:

https://stackoverflow.com/questions/21698009/github-api-502-error

I can give you a cpl of lines to paste in and get the exact file that's causing it, one minute...

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

Using the attached build, once export is done/failed, check the Export Log in the Logs tab and it should end at the failed file when using a Batch Size of 1

dmeagor_debug_urls.zip

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024
  • oops, one more try, above will work, but this gives more info:

dmeagor_debug_urls2.zip

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

@dmeagor, I've started the Debug Mode work with this build. If you check "Enable Debug Mode" in Advanced Tab, then check/refresh the Export Log, you should see the API responses from GitHub for the Create/Update requests.

expandgithubdebugging.zip

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

If you're not seeing any hints from those, the 502 may be coming from the other GH API request, which is hitting the GraphQL endpoint to check if a file exists remotely. Anyway, I'll keep expanding the debugging verbosity across the plugin to help with these kind of issues.

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

@dmeagor, one more recent version here worth trying.
dmeager_debug_mode.zip

Please let me know what the Debug Mode outputs.

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

Hi @kencanak,

Your issue seems a little different, as you're getting a 422 response code with a particular message from GitHub.

What I think is happening, is it's expecting a 'sha' value. The plugin, for this file, seems to be trying to do a CREATE, but an existing file was found in the repo and so it needs an UPDATE. Either the deploy cache from a previous deploy is incorrect or changes have been made to the repo outside of the plugin.

Please try these steps to troubleshoot:

  • delete Deploy caches (Advanced tab)
  • try export/deploy again

failing that:

  • delete Deploy caches (Advanced tab)
  • turn on Debug Mode (also Advanced tab)
  • do export/deploy
  • view the Export Log (Logs tab)

If you can email me the export log at this point, I may be able to deduce what's happening: [email protected]

Cheers,

Leon

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

no worries, @dmeagor, delay was probably a blessing as a few bugfixes went out in the meantime

from static-html-output.

kencanak avatar kencanak commented on May 28, 2024

Hey @leonstafford , I am encountering the same issue with version 6.5.1

This was the error

API response code 200
API response body {"data":{"repository":{"object":null}}}
Creating public/xxx/index.html in GitHub
API response code 422
API response body {"message":"Invalid request.\n\n"sha" wasn't supplied.","documentation_url":"https://developer.github.com/v3/repos/contents/#update-a-file"}
BAD RESPONSE STATUS FROM API (422)
Deployment: error encountered
Exception: BAD RESPONSE STATUS FROM API (422)

Hey @leonstafford , sent the log to you on Tuesday :)

from static-html-output.

skezo avatar skezo commented on May 28, 2024

With the latest build 6.5.3 I am getting a 500 error when uploading to Github.

Creating public/wp-content/uploads/2018/06/Article-768x403.jpg in GitHub
API response code 500
API response body 
BAD RESPONSE STATUS FROM API (500)
Deployment: error encountered
Exception: BAD RESPONSE STATUS FROM API (500) in /home/guff/public_html/wp-content/plugins/static-html-output-plugin/library/StaticHtmlOutput/SitePublisher.php:2
Stack trace:
#0 /home/guff/public_html/wp-content/plugins/static-html-output-plugin/powerpack/GitHub.php(14): StaticHtmlOutput_SitePublisher->checkForValidResponses(500, Array)
leonstafford/wp2static#1 /home/guff/public_html/wp-content/plugins/static-html-output-plugin/powerpack/GitHub.php(2): StaticHtmlOutput_GitHub->createFileInGitHub()
leonstafford/wp2static#2 /home/guff/public_html/wp-content/plugins/static-html-output-plugin/powerpack/GitHub.php(2): StaticHtmlOutput_GitHub->upload_files()
leonstafford/wp2static#3 /home/guff/public_html/wp-content/plugins/static-html-output-plugin/powerpack/GitHub.php(14): StaticHtmlOutput_GitHub->__construct()
leonstafford/wp2static#4 /home/guff/public_html/wp-content/plugins/static-html-output-plugin/library/StaticHtmlOutput/Dispatcher.php(2): require_once('/home/guff/...')
leonstafford/wp2static#5 /home/guff/public_html/wp-content/plugins/static-html-output-plugin/wp2static.php(17): require_once('/home/guff/...')
leonstafford/wp2static#6 /home/guff/public_html/wp-settings.php(305): include_once('/home/guff/...')
leonstafford/wp2static#7 /home/guff/public_html/wp-config.php(90): require_once('/home/guff/...')
leonstafford/wp2static#8 /home/guff/public_html/wp-load.php(37): require_once('/home/guff/...')
leonstafford/wp2static#9 /home/guff/public_html/wp-admin/admin-ajax.php(22): require_once('/home/guff/...')
leonstafford/wp2static#10 {main}

from static-html-output.

dmeagor avatar dmeagor commented on May 28, 2024

log sent privately.

from static-html-output.

dmeagor avatar dmeagor commented on May 28, 2024

Found a workaround by exporting to a static folder and doing git commit/push from the command line. which has reduced the deployment time from about 90 mins to about 4 and is much more secure.

Unfortunately relative urls are broken so I'm again at an impasse (listed as a separate issue.)

from static-html-output.

HeyNitin avatar HeyNitin commented on May 28, 2024

2021-03-27 01:01:53 2021-03-26 07:31:53
PHP VERSION 7.4.13
OS VERSION Windows NT NITINS-PC 10.0 build 19042 (Windows 10) AMD64
WP VERSION 5.7
WP URL http://localhost/wordpress
WP SITEURL http://localhost/wordpress
WP HOME http://localhost/wordpress
WP ADDRESS http://localhost/wordpress
PLUGIN VERSION 6.6.21
VIA WP-CLI?
STATIC EXPORT URL https://07nitin07.github.io/Decoding-D-Street
PERMALINK STRUCTURE /%postname%/
SERVER SOFTWARE Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.4.13
2021-03-27 01:01:53 Active plugins:
2021-03-27 01:01:53 addons-for-elementor/addons-for-elementor.php
2021-03-27 01:01:53 all-in-one-wp-migration/all-in-one-wp-migration.php
2021-03-27 01:01:53 astra-sites/astra-sites.php
2021-03-27 01:01:53 elementor/elementor.php
2021-03-27 01:01:53 static-html-output-plugin/static-html-output-plugin.php
2021-03-27 01:01:53 wpforms-lite/wpforms.php
2021-03-27 01:01:53 Plugin options:
2021-03-27 01:01:54 additionalUrls:
2021-03-27 01:01:54 baseUrl:
2021-03-27 01:01:54 baseUrl-bitbucket:
2021-03-27 01:01:54 baseUrl-bunnycdn:
2021-03-27 01:01:54 baseUrl-github:
2021-03-27 01:01:54 baseUrl-gitlab:
2021-03-27 01:01:54 baseUrl-netlify:
2021-03-27 01:01:54 baseUrl-s3:
2021-03-27 01:01:54 baseUrl-zip:
2021-03-27 01:01:54 baseUrl-zip:
2021-03-27 01:01:54 basicAuthPassword: *******************
2021-03-27 01:01:54 basicAuthUser:
2021-03-27 01:01:54 bbBranch:
2021-03-27 01:01:54 bbRepo:
2021-03-27 01:01:54 bbToken: *******************
2021-03-27 01:01:54 bunnycdnStorageZoneAccessKey: *******************
2021-03-27 01:01:55 bunnycdnPullZoneAccessKey: *******************
2021-03-27 01:01:55 bunnycdnPullZoneID:
2021-03-27 01:01:55 bunnycdnStorageZoneName:
2021-03-27 01:01:55 bunnycdn_api_host: *******************
2021-03-27 01:01:55 cfDistributionId:
2021-03-27 01:01:55 completionEmail:
2021-03-27 01:01:55 crawl_delay:
2021-03-27 01:01:55 crawl_increment:
2021-03-27 01:01:55 crawlPort:
2021-03-27 01:01:56 delayBetweenAPICalls:
2021-03-27 01:01:56 deployBatchSize:
2021-03-27 01:01:56 excludeURLs:
2021-03-27 01:01:56 ghBranch:
2021-03-27 01:01:56 ghCommitMessage:
2021-03-27 01:01:56 ghRepo:
2021-03-27 01:01:56 ghToken: *******************
2021-03-27 01:01:56 glBranch:
2021-03-27 01:01:56 glProject:
2021-03-27 01:01:56 glToken: *******************
2021-03-27 01:01:56 netlifyHeaders:
2021-03-27 01:01:56 netlifyPersonalAccessToken: *******************
2021-03-27 01:01:56 netlifyRedirects:
2021-03-27 01:01:57 netlifySiteID:
2021-03-27 01:01:57 removeConditionalHeadComments: 1
2021-03-27 01:01:57 removeHTMLComments: 1
2021-03-27 01:01:57 removeWPLinks: 1
2021-03-27 01:01:57 removeWPMeta: 1
2021-03-27 01:01:57 rewrite_rules:
2021-03-27 01:01:57 rename_rules:
2021-03-27 01:01:57 s3Bucket:
2021-03-27 01:01:57 s3Key:
2021-03-27 01:01:57 s3Region:
2021-03-27 01:01:57 s3Secret: *******************
2021-03-27 01:01:57 selected_deployment_option:
2021-03-27 01:01:57 targetFolder:
2021-03-27 01:01:57 useBasicAuth:
2021-03-27 01:01:57 Installed extensions:
2021-03-27 01:01:58 Core,bcmath,calendar,ctype,date,filter,hash,iconv,json,SPL,pcre,readline,Reflection,session,standard,mysqlnd,tokenizer,zip,zlib,libxml,dom,PDO,bz2,SimpleXML,xml,xmlreader,xmlwriter,apache2handler,openssl,curl,fileinfo,gd,gettext,mbstring,exif,mysqli,pdo_mysql,pdo_sqlite,Phar,ftp
2021-03-27 01:02:05 BAD RESPONSE STATUS (404): /ads.txt
2021-03-27 01:02:06 BAD RESPONSE STATUS (404): /astra-2/
2021-03-27 01:02:07 BAD RESPONSE STATUS (404): /astra-3/
2021-03-27 01:02:10 BAD RESPONSE STATUS (404): /astra-4/
2021-03-27 01:02:11 BAD RESPONSE STATUS (404): /astra-5/
2021-03-27 01:02:12 BAD RESPONSE STATUS (404): /astra-6/
2021-03-27 01:02:13 BAD RESPONSE STATUS (404): /astra-7/
2021-03-27 01:02:14 BAD RESPONSE STATUS (404): /astra/
2021-03-27 01:02:26 BAD RESPONSE STATUS (404): /favicon.ico
2021-03-27 01:02:28 BAD RESPONSE STATUS (404): /hestia/
2021-03-27 01:02:32 BAD RESPONSE STATUS (404): /robots.txt
2021-03-27 01:02:38 BAD RESPONSE STATUS (404): /twentytwentyone/
2021-03-27 01:02:40 BAD RESPONSE STATUS (404): /wordpress/
2021-03-27 01:02:41 BAD RESPONSE STATUS (404): /wordpress/2021/
2021-03-27 01:02:43 BAD RESPONSE STATUS (404): /wordpress/2021/03/
2021-03-27 01:02:44 BAD RESPONSE STATUS (404): /wordpress/2021/03/25/
2021-03-27 01:02:47 BAD RESPONSE STATUS (404): /wordpress/astra-2/
2021-03-27 01:02:48 BAD RESPONSE STATUS (404): /wordpress/astra-3/
2021-03-27 01:02:50 BAD RESPONSE STATUS (404): /wordpress/astra-4/
2021-03-27 01:02:52 BAD RESPONSE STATUS (404): /wordpress/astra-5/
2021-03-27 01:02:53 BAD RESPONSE STATUS (404): /wordpress/astra-6/
2021-03-27 01:02:54 BAD RESPONSE STATUS (404): /wordpress/astra-7/
2021-03-27 01:02:57 BAD RESPONSE STATUS (404): /wordpress/astra/
2021-03-27 01:03:04 BAD RESPONSE STATUS (404): /wordpress/hestia/
2021-03-27 01:03:14 BAD RESPONSE STATUS (404): /wordpress/twentytwentyone/
2021-03-27 01:03:46 BAD RESPONSE STATUS (404): /wp-content/uploads/2019/06/feature3-free-img.png
2021-03-27 01:03:59 Failed saving /wp-json/ to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output//wp-json/index.
2021-03-27 01:03:59 BAD RESPONSE STATUS (400): /wp-json/oembed/1.0/embed
2021-03-27 01:04:01 Failed saving /wp-json/wp/v2/categories/6 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/categories/6/index.
2021-03-27 01:04:03 Failed saving /wp-json/wp/v2/pages/5 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/pages/5/index.
2021-03-27 01:04:07 Failed saving /wp-json/wp/v2/pages/540 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/pages/540/index.
2021-03-27 01:04:08 Failed saving /wp-json/wp/v2/pages/541 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/pages/541/index.
2021-03-27 01:04:09 Failed saving /wp-json/wp/v2/pages/6 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/pages/6/index.
2021-03-27 01:04:11 Failed saving /wp-json/wp/v2/pages/7 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/pages/7/index.
2021-03-27 01:04:12 Failed saving /wp-json/wp/v2/posts/712 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/posts/712/index.
2021-03-27 01:04:14 Failed saving /wp-json/wp/v2/posts/766 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/posts/766/index.
2021-03-27 01:04:15 Failed saving /wp-json/wp/v2/users/1 to C:\xampp\htdocs\wordpress/wp-content/uploads/static-html-output/wp-json/wp/v2/users/1/index.

So what's the issue here?

from static-html-output.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.