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

[Bug]: expose self-update not working #440

Open
schonhoff opened this issue Feb 21, 2025 · 6 comments
Open

[Bug]: expose self-update not working #440

schonhoff opened this issue Feb 21, 2025 · 6 comments

Comments

@schonhoff
Copy link

System architecture

Windows

PHP Version

Herd Version 1.15.0 with PHP 8.3.17

Bug description

Hey,

trying the documented command expose self-update isn't working as expected. In my global composer.json is the following:

{
    "require": {
        "friendsofphp/php-cs-fixer": "^3.0",
        "beyondcode/expose": "^2.3",
        "laravel/installer": "^5.9"
    }
}

If I don't change anything the command will output:

expose self-update

Checking for a new version...
=============================

                                                                                                                        
 [OK] You have the latest version installed.       

If I change the composer.json to the following:

{
    "require": {
        "friendsofphp/php-cs-fixer": "^3.0",
        "laravel/installer": "^5.9",
        "exposedev/expose": "^3.0"
    }
}

and use composer global update it will output:

composer global update -W
Changed current directory to C:/Users/schon/AppData/Roaming/Composer
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires exposedev/expose ^3.0 -> satisfiable by exposedev/expose[3.0.0, 3.0.1].
    - exposedev/expose[3.0.0, ..., 3.0.1] require cboden/ratchet dev-master -> found cboden/ratchet[dev-master] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

After that I tried thisn change:

{
    "require": {
        "friendsofphp/php-cs-fixer": "^3.0",
        "laravel/installer": "^5.9",
        "exposedev/expose": "^3.0"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

output:

composer global update -W
Changed current directory to C:/Users/schon/AppData/Roaming/Composer
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires exposedev/expose ^3.0 -> satisfiable by exposedev/expose[3.0.0, 3.0.1].
    - exposedev/expose[3.0.0, ..., 3.0.1] require react/http dev-websocket-support -> found react/http[v0.1.0, ..., v0.8.7, v1.0.0, ..., 1.x-dev, 3.x-dev] but it does not match the constraint.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
expose self-update

Checking for a new version...
=============================
                                                                                                                        
 [OK] You have the latest version installed.         

Sometimes I get the log output below. But I cannot reproduce this sadly :/

What am I missing?

Steps to reproduce

No response

Relevant log output

expose self-update

Checking for a new version...
=============================

PHP Fatal error:  Uncaught ErrorException: include(): zlib: data error in phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php:571
Stack trace:
#0 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'include(): zlib...', 'phar://C:/Users...', 571)
#1 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php(571): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(8, 'include(): zlib...', 'phar://C:/Users...', 571)
#2 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php(571): include('phar://C:/Users...')
#3 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('phar://C:/Users...')
#4 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Foun...')
#5 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/illuminate/container/Container.php(889): ReflectionClass->__construct('Illuminate\\Foun...')
#6 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/illuminate/container/Container.php(770): Illuminate\Container\Container->build('Illuminate\\Foun...')
#7 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Application.php(862): Illuminate\Container\Container->resolve('Illuminate\\Foun...', Array, false)
#8 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/illuminate/container/Container.php(295): Illuminate\Foundation\Application->resolve('Illuminate\\Foun...', Array, false)      
#9 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/illuminate/container/Container.php(885): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(LaravelZero\Framework\Application), Array)
#10 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/illuminate/container/Container.php(770): Illuminate\Container\Container->build(Object(Closure))
#11 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Application.php(862): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array, true)
#12 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/illuminate/container/Container.php(706): Illuminate\Foundation\Application->resolve('Illuminate\\Cont...', Array)
#13 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Application.php(847): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#14 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(299): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#15 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(218): Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler()
#16 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(204): Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole(Object(ErrorException))
#17 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(ErrorException))
#18 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(Object(ErrorException))
#19 {main}
  thrown in phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php on line 571
PHP Fatal error:  Uncaught ErrorException: include(): zlib: data error in phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php:571
Stack trace:
#0 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'include(): zlib...', 'phar://C:/Users...', 571)
#1 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php(571): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(8, 'include(): zlib...', 'phar://C:/Users...', 571)
#2 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php(571): include('phar://C:/Users...')
#3 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('phar://C:/Users...')
#4 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Composer\Autoload\ClassLoader->loadClass('Symfony\\Compone...')
#5 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(242): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalErrorFromPhpError(Array, 0)
#6 phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#7 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#8 {main}
  thrown in phar://C:/Users/schon/AppData/Roaming/Composer/vendor/exposedev/expose/builds/expose/.box/vendor/composer/ClassLoader.php on line 571
@mpociot
Copy link
Collaborator

mpociot commented Feb 21, 2025

The zlib: data error is odd.
Which extensions do you have installed locally?

@schonhoff
Copy link
Author

Here is my php.ini (needed to change it to .txt because of Github uploads...

php.txt

@daugaard47
Copy link

On windows I cannot run expose self-update either.

In Updater.php line 417:

  rename(C:\Users\dauga\.config\herd\bin/expose.phar.temp,C:\Users\dauga\.config\herd\bin\expose.phar): Access is den
  ied (code: 5)

I've been an expose pro user before herd came out so I removed my global beyond code version and global exposedev version and rely on Herd expose now.

To get it to work in 3.0.1 I had to download the repo and do the following

  • Add .phar extension to the expose file in the builds folder
  • Remove the existing expose.phar in Herd's bin directory | C:\Users\dauga\.config\herd\bin\expose.phar
  • Move the new expose.phar to Herd's bin directory
  • herd restart
  • Now expose is updated, but reverts back once I close down and reopen herd

I ended up creating a script to do this to save time.
Now I will have to do the same thing, but since 3.0.2 has direct access to the expose.phar file I can remove a couple steps above.

@mpociot Please put out a windows herd update with the new Expose version.

Here is the script that I run in case anyone want to do this. (Use at your own risk!)

  1. Just download the new expose.phar file from here
  2. Add it to your herd directory
  3. Create a UpdateExpose3-2.bat file on your desktop
  4. Copy the below and change your-name-here to your windows username
  5. Run as Admin
@echo off
echo Updating Expose for Herd...

:: Copy the original expose binary to preserve it
copy "C:\Users\your-name-here\Herd\expose\builds\expose" "C:\Users\your-name-here\Herd\expose\builds\expose_copy" /Y

:: Rename the copied file to expose.phar
rename "C:\Users\your-name-here\Herd\expose\builds\expose_copy" "expose.phar"

:: Remove the existing expose.phar in Herd's bin directory
del "C:\Users\your-name-here\.config\herd\bin\expose.phar" /F /Q

:: Move the new expose.phar to Herd's bin directory
move "C:\Users\your-name-here\Herd\expose\builds\expose.phar" "C:\Users\your-name-here\.config\herd\bin\expose.phar"

:: Verify the updated version
php C:\Users\your-name-here\.config\herd\bin\expose.phar --version

:: Restart Herd
herd restart

:: Verify Expose after restart
expose --version

echo Update complete! Press any key to exit...
pause >nul

Image

Here is the full error.
expose-self-update-windows-error.txt

@rosswintle
Copy link

I'm trying to do an update from Expose v2 to v3 and I'm getting the same output that @schonhoff got:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires beyondcode/expose ^3.0 -> satisfiable by beyondcode/expose[3.0.0, 3.0.1, 3.0.2].
    - beyondcode/expose[3.0.0, ..., 3.0.2] require react/http dev-websocket-support -> found react/http[v0.1.0, ..., v0.8.7, v1.0.0, ..., 1.x-dev, 3.x-dev] but it does not match the constraint.

The required constraint dev-websocket-support no longer exists as a tag or branch of https://github.com/reactphp/http

@IE-Dev
Copy link

IE-Dev commented Feb 23, 2025

I encountered the same error as @schonhoff. To resolve it, I installed the extension php{version}-zip, which fixed the initial issue.

However, I then faced another error: production.ERROR: could not find driver (Connection: sqlite. To address this, I installed php{version}-sqlite3.

After installing both extensions, all issues were resolved.

I hope this helps others facing similar problems 😄

@hivokas
Copy link

hivokas commented Feb 24, 2025

This is mine:

Problem 1
    - Root composer.json requires beyondcode/expose ^3.0 -> satisfiable by beyondcode/expose[3.0.0, 3.0.1, 3.0.2].
    - beyondcode/expose[3.0.0, ..., 3.0.2] require cboden/ratchet dev-master -> found cboden/ratchet[dev-master] but it does not match your minimum-stability.

Could we require specific version of cboden/ratchet rather than dev-master?

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

No branches or pull requests

6 participants