XBackBone icon indicating copy to clipboard operation
XBackBone copied to clipboard

Unable to update XBackBone

Open 6K6666 opened this issue 5 years ago • 11 comments

System Info

  • PHP Version: 8.0.7
  • XBackBone Version: 3.3.5
  • Webserver: [Apache/Nginx/...] Apache
  • Database backend: [SQLite/Mysql/...] sqlite

Describe the bug A clear and concise description of what the bug is.

Cannot update XBackBone due to "Cannot contact GitHub API. Try again."

Not sure if this is a me issue (not sure how to check/troubleshoot) or if it's an issue with something else

To Reproduce Steps to reproduce the behavior:

  1. have my setup above
  2. go to updates
  3. try updating
  4. See error (and cry)

Expected behavior XBackBone upgrades to whatever the latest version is

Screenshots

https://voided.dev/cdn/POWA6/zALopoyE74.png

Logs where can i find these?

Help appreciated. Even if I have to update everything manually (somehow) some help with that would be much appreciated as well. :)

6K6666 avatar Aug 26 '21 02:08 6K6666

System Info

  • PHP Version: 8.0.7
  • XBackBone Version: 3.3.5
  • Webserver: [Apache/Nginx/...] Apache
  • Database backend: [SQLite/Mysql/...] sqlite

Describe the bug A clear and concise description of what the bug is.

Cannot update XBackBone due to "Cannot contact GitHub API. Try again."

Not sure if this is a me issue (not sure how to check/troubleshoot) or if it's an issue with something else

To Reproduce Steps to reproduce the behavior:

  1. have my setup above
  2. go to updates
  3. try updating
  4. See error (and cry)

Expected behavior XBackBone upgrades to whatever the latest version is

Screenshots

https://voided.dev/cdn/POWA6/zALopoyE74.png

Logs where can i find these?

Help appreciated. Even if I have to update everything manually (somehow) some help with that would be much appreciated as well. :)

I was able to fix my issue by manually upgrading but I still can't upgrade with the built in upgrade function and it's frustrating. Not sure how to fix.

6K6666 avatar Aug 26 '21 03:08 6K6666

If you perform this curl from your host the request is successful?

curl -A "XBackBone-App" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/SergiX44/XBackBone/releases

sergix44 avatar Aug 26 '21 16:08 sergix44

If you perform this curl from your host the request is successful?

curl -A "XBackBone-App" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/SergiX44/XBackBone/releases

Yeah it prints the json file to the console i think. Also, for some reason the themes are not loading now and i'm stuck with the light theme.

6K6666 avatar Aug 26 '21 17:08 6K6666

Mm probably there is an issue for your php installation to contact external http resources

<?php

$opts = [
    'http' => [
        'method' => 'GET',
        'header' => [
            'User-Agent: XBackBone-App',
            'Accept: application/vnd.github.v3+json',
        ],
    ],
];

$data = file_get_contents('https://api.github.com/repos/SergiX44/XBackBone/releases', false, stream_context_create($opts));

echo $data;

Can you try to run this script?

sergix44 avatar Aug 26 '21 17:08 sergix44

Mm probably there is an issue for your php installation to contact external http resources

<?php

$opts = [
    'http' => [
        'method' => 'GET',
        'header' => [
            'User-Agent: XBackBone-App',
            'Accept: application/vnd.github.v3+json',
        ],
    ],
];

$data = file_get_contents('https://api.github.com/repos/SergiX44/XBackBone/releases', false, stream_context_create($opts));

echo $data;

Can you try to run this script?

No output.

6K6666 avatar Aug 26 '21 17:08 6K6666

Check that your php installation ~has php-stream~(should be part of the phpcore now) and allow_url_fopen enabled https://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen

sergix44 avatar Aug 26 '21 17:08 sergix44

allow_url_fopn is enabled

6K6666 avatar Aug 26 '21 17:08 6K6666

same issue php 7.3

iphqne avatar Aug 26 '21 19:08 iphqne

There is something that blocks access to external urls from php, is not an xbackbone bug. This is the same script as before with some error logging forced:

<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$opts = [
    'http' => [
        'method' => 'GET',
        'header' => [
            'User-Agent: XBackBone-App',
            'Accept: application/vnd.github.v3+json',
        ],
    ],
];

$data = file_get_contents('https://api.github.com/repos/SergiX44/XBackBone/releases', false, stream_context_create($opts));

var_dump($data);

Should print something like string (... some the the json you can get from the curl command i posted before:

string(96877) "[{"url":"https://api.github.com/repos/SergiX44/XBackBone/releases/47757778","assets_url":"https://api.github.com/repos/SergiX44/XBackBone/releases/47757778/assets","upload_url":"https://uploads.github.com/repos/SergiX44/XBackBone/releases/47757778/assets{?name,label}","html_url":"https://github.com/SergiX44/XBackBone/releases/tag/3.4.1","id":47757778,"author":{"login":"SergiX44","id":4172890,"node_id":"MDQ6VXNlcjQxNzI4OTA=","avatar_url":"https://avatars.githubusercontent.com/u/4172890?v=4","gravatar_id":"","...

If you perform this curl from your host the request is successful?

curl -A "XBackBone-App" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/SergiX44/XBackBone/releases

sergix44 avatar Aug 26 '21 19:08 sergix44

Fixed it. I had to uncomment extension=openssl in my php.ini config. Updates work now and themes are loading too. Thank you for your help, I was able to get a more descriptive error about something HTTPS related that helped me pinpoint the problem. Love your work, have a good one!

6K6666 avatar Aug 26 '21 20:08 6K6666

worked for me too however "extension=openssl" wasn't already there so instead of uncommenting it i had to manually add it, make sure you restart your php after as well

edit: actually this didn't fix it, in my cpanel i had to switch from "ea-php" to "alt-php" which then used my php selector settings rather than default php settings where allow_url_fopen was enabled image image

iphqne avatar Aug 26 '21 20:08 iphqne