• Resolved hubble5

    (@hubble5)


    Hey Vaakash,

    Thanks for your plugin!

    Unfortunately, I am encountering the same issue as skariko.

    I tried the plugin locally with your example repo and it works perfectly fine.
    However, when I try to pull the posts from my production server, the log prints Repository not found on Github! [https://api.github.com/repos/vaakash/aakash-web/git/trees/master?recursive=1] (when I click on the api endpoint url, everything looks good tho).

    Do you have any ideas?

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    Thanks for trying GIW.

    Since you mentioned fetching the API works in localhost but not in main server, my guess is there could be some “restrictions” or permission denied kind of issue from the main server.

    I would need some debug information.

    Can you please add below log line in git-it-write/includes/repository.php at line number 30 ?

    print_r( $request );

    2) Save the file
    3) “pull only changes” for the repository manually.
    4) Copy all the logs and share it pastebin or here as a reply.

    Thanks,
    Aakash

    Thread Starter hubble5

    (@hubble5)

    Sure thing, here is the log:

    Array ( [headers] => Requests_Utility_CaseInsensitiveDictionary Object ( [data:protected] => Array ( [date] => Tue, 30 Nov 2021 21:00:28 GMT [server] => Varnish [strict-transport-security] => max-age=31536000; includeSubdomains; preload [x-content-type-options] => nosniff [x-frame-options] => deny [x-xss-protection] => 1; mode=block [content-security-policy] => default-src 'none'; style-src 'unsafe-inline' [access-control-allow-origin] => * [access-control-expose-headers] => ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset [content-type] => application/json; charset=utf-8 [referrer-policy] => origin-when-cross-origin, strict-origin-when-cross-origin [x-github-media-type] => github.v3; format=json [x-ratelimit-limit] => 60 [x-ratelimit-remaining] => 0 [x-ratelimit-reset] => 1638309197 [x-ratelimit-resource] => core [x-ratelimit-used] => 60 [content-length] => 280 [x-github-request-id] => CF72:2166:D66507:DDF521:61A690EC ) ) [body] => {"message":"API rate limit exceeded for 91.134.248.253. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"} [response] => Array ( [code] => 403 [message] => Forbidden ) [cookies] => Array ( ) [filename] => [http_response] => WP_HTTP_Requests_Response Object ( [response:protected] => Requests_Response Object ( [body] => {"message":"API rate limit exceeded for 91.134.248.253. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"} [raw] => HTTP/1.1 403 rate limit exceeded Date: Tue, 30 Nov 2021 21:00:28 GMT Server: Varnish Strict-Transport-Security: max-age=31536000; includeSubdomains; preload X-Content-Type-Options: nosniff X-Frame-Options: deny X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline' Access-Control-Allow-Origin: * Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset Content-Type: application/json; charset=utf-8 Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin X-GitHub-Media-Type: github.v3; format=json X-RateLimit-Limit: 60 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1638309197 X-RateLimit-Resource: core X-RateLimit-Used: 60 Content-Length: 280 X-GitHub-Request-Id: CF72:2166:D66507:DDF521:61A690EC connection: close {"message":"API rate limit exceeded for 91.134.248.253. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"} [headers] => Requests_Response_Headers Object ( [data:protected] => Array ( [date] => Array ( [0] => Tue, 30 Nov 2021 21:00:28 GMT ) [server] => Array ( [0] => Varnish ) [strict-transport-security] => Array ( [0] => max-age=31536000; includeSubdomains; preload ) [x-content-type-options] => Array ( [0] => nosniff ) [x-frame-options] => Array ( [0] => deny ) [x-xss-protection] => Array ( [0] => 1; mode=block ) [content-security-policy] => Array ( [0] => default-src 'none'; style-src 'unsafe-inline' ) [access-control-allow-origin] => Array ( [0] => * ) [access-control-expose-headers] => Array ( [0] => ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset ) [content-type] => Array ( [0] => application/json; charset=utf-8 ) [referrer-policy] => Array ( [0] => origin-when-cross-origin, strict-origin-when-cross-origin ) [x-github-media-type] => Array ( [0] => github.v3; format=json ) [x-ratelimit-limit] => Array ( [0] => 60 ) [x-ratelimit-remaining] => Array ( [0] => 0 ) [x-ratelimit-reset] => Array ( [0] => 1638309197 ) [x-ratelimit-resource] => Array ( [0] => core ) [x-ratelimit-used] => Array ( [0] => 60 ) [content-length] => Array ( [0] => 280 ) [x-github-request-id] => Array ( [0] => CF72:2166:D66507:DDF521:61A690EC ) ) ) [status_code] => 403 [protocol_version] => 1.1 [success] => [redirects] => 0 [url] => https://api.github.com/repos/vaakash/aakash-web/git/trees/master?recursive=1 [history] => Array ( ) [cookies] => Requests_Cookie_Jar Object ( [cookies:protected] => Array ( ) ) ) [filename:protected] => [data] => [headers] => [status] => ) )

    Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    Sorry for the delay.

    From the collected logs you can see that the Github request has exceeded the limit.

    API rate limit exceeded for 91.134.248.253. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details

    Since Git it write does not do any authentication so there is a limit of 60 requests per hour. (may be this is something I need to work in the future)

    Git it write does not do those many requests in an hour.
    May be some other application did that (there is an IP mentioned in the log above, do you know what is that IP ?).

    For now can you please try again and see if it works ?

    Thanks,
    Aakash

    Thread Starter hubble5

    (@hubble5)

    Hello Vaakash,

    The IP is my OVH gateway IP, I need to figure out why the server does all those requests.

    Unfortunately, I’ve just tried out and experienced the same log with the same IP.

    Thanks

    Thread Starter hubble5

    (@hubble5)

    Hello Vaakash,

    Since the outgoing IP address is shared with all OVH users (https://docs.ovh.com/us/en/hosting/list-of-ip-addresses-of-web-hosting-clusters/), is it possible all users of the same Web Hosting face the same issue?

    What do you think?

    Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    I think this might be the reason in shared web hosting servers.

    I never factored in this scenario, I might have to implement github authentication to get over this.

    Please give me some time I would need to do some research on any quick workaround or see if I can quickly implement Github authentication and publish a release.

    I’ll let you know in couple of days.

    Thanks,
    Aakash

    Thread Starter hubble5

    (@hubble5)

    Hello Vaakash,

    Have you found any workaround?

    Thanks,
    Olivier

    Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    I’m Extremely sorry. I did not get a chance to work on this.. ?? Caught up in other plugin dev.

    Please give me couple of days.. I’ll get back to you with a workaround.

    Thanks,
    Aakash

    Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    Can you please make below change in plugin editor ?

    Go to plugin editor –> select git-it-write/includes/repository.php

    Replace

        public function get( $url ){
    
            $request = wp_remote_get( $url );

    with this

    Note:
    Don’t forget to set your username and access token below.

        public function get( $url ){
    
            $username = 'enter_your_github_username';
            $access_token = 'enter_your_access_token';
            $args = array(
                'headers' => array(
                    'Authorization' => 'Basic ' . base64_encode($username . ':' . $access_token),
                ),
            ); 
    
            $request = wp_remote_get( $url, $args );

    Save the file.
    Your request should work now. You can “pull all changes” to fire a new request.

    Getting the token

    1) Go to github setting page – https://github.com/settings/tokens
    2) Give a name for the token
    3) Give a date for expiration
    4) Select public_repo under scopes
    5) Generate token
    6) Use the token above.

    I’ll incorporate this in the next version where you can provide all these info from the admin page itself.

    Thanks,
    Aakash

    Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    Did you get a chance to try above changes ? Was it helpful ?

    Thanks,
    Aakash

    Plugin Author vaakash

    (@vaakash)

    Hi @hubble5,

    This is addressed in v1.4. You can upgrade the plugin and enter the Github username and access token in the plugin settings page.

    Thanks,
    Aakash

    Thread Starter hubble5

    (@hubble5)

    Hello Vaakash,

    Sorry for the late reply, I was on vacation.
    I’ve just updated the plugin and tested with my access token and everything works like a charm!

    Thanks Vaakash ?

    Plugin Author vaakash

    (@vaakash)

    Excellent ! Good to hear that ??

    Thanks for confirming.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Repository not found on Github!’ is closed to new replies.