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

usort: Array was modified by the user comparison function #258

Closed
6 tasks done
postfriday opened this issue Aug 11, 2016 · 7 comments
Closed
6 tasks done

usort: Array was modified by the user comparison function #258

postfriday opened this issue Aug 11, 2016 · 7 comments
Labels

Comments

@postfriday
Copy link

postfriday commented Aug 11, 2016

Before submitting your issue, please make sure that you've checked all of the checkboxes below.

  • You're running the latest release version of Deployer.
  • Ensure that you're running at least PHP 5.5.9, you can check this by running php -v
  • You've ran composer install --no-dev from the root of your installation.
  • You've ran npm install --production from the root of your installation.
  • You've ran rm -rf bootstrap/cache/* from the root of your installation.
  • You have restarted the queue listener and node socket server.

To help us better understand your issue, please answer the following.

Expected behaviour

Tried to open project dashboard (/projects/1), expected to see dashboard.

Actual behaviour

ErrorException in Project.php line 414:
usort(): Array was modified by the user comparison function

Steps to reproduce

New instance of the Deployer with one project.
Opening project dashboard after first manual deploy generates an exception.

Environment info

Operating System: Ubuntu 14.04.4
PHP Version: 5.6.23
Node Version: 4.4.7
Database System: MySQL
Database Version: 5.5.50

Logs (see storage/logs/) or other output that would be helpful

[2016-08-11 12:46:12] production.ERROR: exception 'ErrorException' with message 'usort(): Array was modified by the user comparison function' in /var/www/src/app/Project.php:414
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'usort(): Array ...', '/var/www/deploy...', 414, Array)
#1 /var/www/src/app/Project.php(414): usort(Array, Object(Closure))
#2 /var/www/src/app/Http/Controllers/DeploymentController.php(75): REBELinBLUE\Deployer\Project->tags()
#3 [internal function]: REBELinBLUE\Deployer\Http\Controllers\DeploymentController->project('1')
#4 /var/www/src/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(80): call_user_func_array(Array, Array)
#5 /var/www/src/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(146): Illuminate\Routing\Controller->callAction('project', Array)

...

@REBELinBLUE
Copy link
Owner

Hmm, I shall take a look at this after I finish work

@REBELinBLUE
Copy link
Owner

This seems to be a bug in PHP

http://stackoverflow.com/questions/3235387/usort-array-was-modified-by-the-user-comparison-function?answertab=votes#tab-top

Because the usort function throws an exception even though it is caught. I will suppress it

@REBELinBLUE
Copy link
Owner

Can you give me the output of git tag -l for project 1 in deployer?

@postfriday
Copy link
Author

postfriday commented Aug 17, 2016

root@de-phpci-01:/var/www/src$ git tag -l
...

@REBELinBLUE
Copy link
Owner

Sorry, I don't mean deployer itself but the repository for the project you have set up in deployer

@postfriday
Copy link
Author

Sorry, my bad.

0.1.1
125
135
404
bugfix
push-world-integration
push-world-integration-manifest
r.js
stats-platforms
table-tfoot

@REBELinBLUE
Copy link
Owner

Thanks, I have managed to recreate the issue with that data, only happens prior to PHP 7

@REBELinBLUE REBELinBLUE changed the title usort(): Array was modified by the user comparison function usort: Array was modified by the user comparison function Aug 21, 2016
REBELinBLUE added a commit that referenced this issue Aug 21, 2016
* master:
  Updated version
  Updated CHANGELOG
  Updated dependencies
  Fixes #258 - Fatal error in PHP 5 when git tags are not valid version numbers
REBELinBLUE added a commit that referenced this issue Aug 21, 2016
* master: (33 commits)
  Updated version
  Updated CHANGELOG
  Updated dependencies
  Fixes #258 - Fatal error in PHP 5 when git tags are not valid version numbers
  Fixing version
  Updated CHANGELOG
  Fix the installer to correctly check for either "node" or "nodejs"
  Updated dependencies
  Delete .travis.yml
  Create .travis.yml
  Updated CHANGELOG
  Updated CHANGELOG
  Updated CHANGELOG
  Updated CHANGELOG
  Fixed link
  Updated CHANGELOG
  Fixes #257 - Touch files when extracting to prevent warnings about timestamps
  Update README.md
  Added a note about a common error
  Updated ioredis
  ...

Conflicts:
	composer.json
	composer.lock
	gulpfile.js
	package.json
	resources/assets/js/app.js
	socket.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants