Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL error 3 during update #707

Closed
web541 opened this issue May 20, 2020 · 11 comments · Fixed by #710
Closed

cURL error 3 during update #707

web541 opened this issue May 20, 2020 · 11 comments · Fixed by #710
Labels
Milestone

Comments

@web541
Copy link
Contributor

web541 commented May 20, 2020

Describe the bug
As reference on the forum thread here the /update is throwing a cURL 3 error for a number of users. I've done some investigation on it which I provide below.

Version
7.0.0-beta.3
7.0.0-beta.4
dev branch

To Reproduce
Steps to reproduce the behavior:

  1. Go to Admin Panel -> Maintenance -> Update or /update route
  2. Click "Update"
  3. Error thrown
GuzzleHttp\Exception\RequestException
cURL error 3: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Expected behavior
Update of phpVMS installation (as far as I'm aware)

Bit of investigation
On all versions tested above the same error is thrown. On beta.4 the update fails to recognise that there is no update available as it should already be on the latest version. On dev, not sure if it's supposed to do the same as it's completely different and I assume the update is pulling off the master branch?
The updater doesn't seem to like this line (UpdateModule -> UpdateController.php line 134). So I did some dumping and doing something like this:

        $version = $this->kvpRepo->get('latest_version_tag');
        $release = $this->updateManager->source('github')->getVersionAvailable();
        dd($release);
        $this->updateManager->source('github')->update($version);

Should have brought back "7.0.0-beta.4" or similar as the most up-to-date version. Instead, it throws the cURL error.
Similarly, doing this:

        $version = $this->kvpRepo->get('latest_version_tag');
        $release = $this->updateManager->source('github')->getVersionInstalled();
        dd($release);
        $this->updateManager->source('github')->update($version);

Should have brought back the version currently installed, but instead it returns null. If I adjust the config/self-update.php 'version_installed' key to the current version (as seen in php artisan phpvms:version and run the code again, this time it gives the current version but then sets this value to '' again in the config file.
Upon looking into the cURL error 3, I believe it's a URL issue somewhere. So looking into the vendor's self-update GithubTagTest.php file and dumping this line it gives me this "/repos/nabeelio/phpvms/tags".

The only way I could get rid of the cURL error was to manually specify this:
$url = "https://api.github.com/repos/nabeelio/phpvms/releases";
before this line in the vendor's file (which I will revert). And update the UpdateController to this:

        $version = $this->kvpRepo->get('latest_version_tag');
        $release = $this->updateManager->source('github')->getVersionAvailable();
        $this->updateManager->source('github')->update($release);

After this, the installer runs fine, no errors and the update successfully dumps to storage/app/*version. The update fails to recognise after that it has updated (still says "update available" in the admin panel" and at this point, the config/self-update.php 'version_installed' reverts to an empty string ''.

As a sidenote, if I dump $version from here:

        $version = $this->kvpRepo->get('latest_version_tag');
        $this->updateManager->source('github')->update($version);

it returns null. And I think there's supposed to be a storage/app/kvp.json file (could be wrong) but it doesn't look like there is one there. The /storage directory is set to 777 to ensure that it's not a permissions issue.

Sorry if this is a bit overkill (hopefully a simple fix) but I thought I'd do some digging. Not sure if the installer has worked prior to beta 3 or if it's a change made to beta 4.

Additional context
Attached is the log file
laravel-2020-05-20.log

@nabeelio
Copy link
Owner

Thanks for looking into this in detail! I just started taking a cursory look a few days ago. I think I need to move the kvp store into the database to start.

Question - do you have the cron setup?

@web541
Copy link
Contributor Author

web541 commented May 21, 2020

Nope no cron (just a quick test locally on valet), but now that you've mentioned it that would make a difference. I wonder if the others have the cron setup.

@nabeelio
Copy link
Owner

Ok cool, I think I need to rework a few things including the KVP store and also running the update check on demand (which it should be doing it but it seems like there's still an issue there)

@nabeelio nabeelio added the bug label May 21, 2020
@nabeelio nabeelio added this to the 7.0.0 milestone May 21, 2020
@nabeelio
Copy link
Owner

Also, do you have pre-release versions checked in settings? There's no release versions found so it can only go off of pre-release versions.

And beware, I have to block updates from actually happening if you're on dev, but it will downgrade from dev to a beta version which might cause problems. But I'm fixing some of the issues you've brought up right now

@nabeelio
Copy link
Owner

Hey, so if you download the dev version, in config/version.yaml, change prerelease to beta.3, and then try updating. The force update check should would

@web541
Copy link
Contributor Author

web541 commented May 21, 2020

Pre-release wasn't checked as it was off by default, so I'll enable that. I've got a beta version and a dev version running separately so that shouldn't be an issue if I update the dev and keep it separate. Will give it a go now.

@web541
Copy link
Contributor Author

web541 commented May 21, 2020

So the version control seems to be working now. Installed a fresh clone of the dev branch, checked pre-release in the settings, changed 'dev' to 'beta.3' in config/version.yaml and it looks like it updated fine. Only issue is that after it updated, /update/step1 (and sometimes /update/downloader when POST) throws a 500 due to it having installed beta.4 over the dev which reverted the changed to the Updater module

nabeelio added a commit that referenced this issue May 22, 2020
Make sure the Updater module is enabled #707
@nabeelio
Copy link
Owner

nabeelio commented May 22, 2020

Ok, that's great! I just realized that the module may also be disabled. There isn't a module enable/disable panel yet.

On the dev branch, it shouldn't alert you to a new version now either. I'm gonna leave this open for now because I think there's probably another bug or two lurking in here, and I remember writing them down somewhere...

@web541
Copy link
Contributor Author

web541 commented May 22, 2020

Sounds good! Yeah that's better for the dev branch. Haven't tested with your latest commit but before it would only show the alert to a new version if you did the force update which is expected (and now working).

@nabeelio
Copy link
Owner

I'll close this one for now

@VahidNZ
Copy link

VahidNZ commented May 4, 2021

Hi @nabeelio
I have the same issue and as I checked my corn jb is working well and also the updater module is enabled now but I still getting the below error:

cURL error 3: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants