squigg / azure-queue-laravel

PHP Laravel Queue Driver package for Microsoft Azure Storage Queues
44 stars 24 forks source link

Unable to install on Laravel 5.5.* #5

Closed uxweb closed 6 years ago

uxweb commented 6 years ago

Hi!,

I'm having problems when installing your great package on Laravel 5.5.25.

Here's the error message I get when trying to install the package:

composer require "squigg/azure-queue-laravel:5.5.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - squigg/azure-queue-laravel v5.5.1 requires microsoft/azure-storage ~0.18.0 -> satisfiable by microsoft/azure-storage[v0.18.0] but these conflict with your requirements or minimum-stability.
    - squigg/azure-queue-laravel v5.5.0 requires microsoft/azure-storage ~0.18.0 -> satisfiable by microsoft/azure-storage[v0.18.0] but these conflict with your requirements or minimum-stability.
    - Installation request for squigg/azure-queue-laravel 5.5.* -> satisfiable by squigg/azure-queue-laravel[v5.5.0, v5.5.1].

Installation failed, reverting ./composer.json to its original content.

Here's my queue.php configuration file contents:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Default Queue Driver
    |--------------------------------------------------------------------------
    |
    | Laravel's queue API supports an assortment of back-ends via a single
    | API, giving you convenient access to each back-end using the same
    | syntax for each one. Here you may set the default queue driver.
    |
    | Supported: "sync", "database", "beanstalkd", "sqs", "redis", "null"
    |
    */

    'default' => env('QUEUE_DRIVER', 'sync'),

    /*
    |--------------------------------------------------------------------------
    | Queue Connections
    |--------------------------------------------------------------------------
    |
    | Here you may configure the connection information for each server that
    | is used by your application. A default configuration has been added
    | for each back-end shipped with Laravel. You are free to add more.
    |
    */

    'connections' => [
        'sync' => [
            'driver' => 'sync',
        ],

        'database' => [
            'driver' => 'database',
            'table' => 'jobs',
            'queue' => 'default',
            'retry_after' => 90,
        ],

        'beanstalkd' => [
            'driver' => 'beanstalkd',
            'host' => 'localhost',
            'queue' => 'default',
            'retry_after' => 90,
        ],

        'sqs' => [
            'driver' => 'sqs',
            'key' => 'your-public-key',
            'secret' => 'your-secret-key',
            'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
            'queue' => 'your-queue-name',
            'region' => 'us-east-1',
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
            'queue' => 'default',
            'retry_after' => 90,
        ],

        'azure' => [
            'driver' => 'azure',
            'protocol' => 'https',
            'accountname' => env('AZURE_STORAGE_NAME'),
            'key' => env('AZURE_STORAGE_KEY'),
            'queue' => env('AZURE_QUEUE_NAME', 'default'),
            'timeout' => 60,
            'retry_after' => 310,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Failed Queue Jobs
    |--------------------------------------------------------------------------
    |
    | These options configure the behavior of failed queue job logging so you
    | can control which database and table are used to store the jobs that
    | have failed. You may change them to any database / table you wish.
    |
    */

    'failed' => [
        'database' => env('DB_CONNECTION', 'mysql'),
        'table' => 'failed_jobs',
    ],
];

Software versions This Package: Laravel: 5.5.25 PHP: 7.1.12 Operating System: MacOS

squigg commented 6 years ago

Can you post the contents of your composer.json file? Seems like there is perhaps a conflict in there.

Particularly check for any constraints on "microsoft/azure-storage" in your composer.json and if present, remove them so that this package can install the desired version.

uxweb commented 6 years ago

@squigg Thanks for answer! This are the contents of my composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.0.0",
        "barryvdh/laravel-cors": "^0.9.3",
        "fideloper/proxy": "~3.3",
        "guzzlehttp/guzzle": "^6.3",
        "laracasts/flash": "^3.0",
        "laravel/framework": "5.5.*",
        "laravel/passport": "^3.0",
        "laravel/tinker": "~1.0",
        "league/flysystem-azure": "^1.0",
        "maatwebsite/excel": "^2.1",
        "microsoft/azure-storage": "~0.10.1",
        "overtrue/laravel-lang": "^3.0",
        "predis/predis": "^1.1",
        "spatie/laravel-permission": "^2.5",
        "spatie/laravel-sluggable": "^2.1",
        "webpatser/laravel-uuid": "^3.0"
    },
    "require-dev": {
        "appointer/swaggervel": "^2.1",
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories",
            "database/AudienceFilterFactory.php"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}
squigg commented 6 years ago

Hi

Please remove the line in your composer.json for "microsoft/azure-storage" and then retry.

If you are using the Microsoft package yourself directly in your code then you may need to make any changes necessary to use the later version.

Cheers

squigg commented 6 years ago

@uxweb did you get this sorted?

uxweb commented 6 years ago

@squigg Thanks!

The issue is still happening after removing "microsoft/azure-storage": "~0.10.1", from the composer.json file.

Here is the output generated by composer when running composer require squigg/azure-queue-laravel

Using version ^5.5 for squigg/azure-queue-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - squigg/azure-queue-laravel v5.5.0 requires microsoft/azure-storage ~0.18.0 ->satisfiable by microsoft/azure-storage[v0.18.0].
    - squigg/azure-queue-laravel v5.5.1 requires microsoft/azure-storage ~0.18.0 ->satisfiable by microsoft/azure-storage[v0.18.0].
    - Conclusion: don't install microsoft/azure-storage v0.18.0
    - Installation request for squigg/azure-queue-laravel ^5.5 -> satisfiable by squigg/azure-queue-laravel[v5.5.0, v5.5.1].

Installation failed, reverting ./composer.json to its original content.
uxweb commented 6 years ago

@squigg I had the "microsoft/azure-storage": "~0.10.1" package installed directly because I copied all your src package files within my project to make it work with that version of azure storage due to the issue related with installing your package using composer.

uxweb commented 6 years ago

@squigg I think this issue is related with the use of "league/flysystem-azure": "^1.0" in my project. This package requires microsoft/azure-storage: ~0.10.1 so maybe there is a conflict on versions.

squigg commented 6 years ago

@uxweb Great spot, I agree that looks like the problem

There is already a PR open on the league/flysystem-azure repository for upgrading to 0.19.1. Until this gets merged, a temporary fix would be to alias the later version of the microsoft/azure-storage package to be compatible with the flysystem dependency in your composer.json:

"microsoft/azure-storage": "0.19.0 as 0.10.1"

As long as the API remains the same in this later version for flysystem (this appears to be the case based on the pending PR), this will allow you to install and use the package successfully.

judgej commented 6 years ago

In case it is relevant, when installing on L5.5 I get this:

Package microsoft/azure-storage is abandoned, you should avoid using it. Use microsoft/azure-storage-blob, microsoft/azure-storage-table, microsoft/azure-storage-queue, microsoft/azure-storage-file instead.

Does that mean you should not even be using microsoft/azure-storage anyway now? Does the 5.5 branch need an update?

squigg commented 6 years ago

It does indeed - I'll sort it out later today

squigg commented 6 years ago

@judgej Version 5.5.2 now tagged with the stable microsoft/azure-storage dependency

judgej commented 6 years ago

Awesome. All updated without any complaints from L5.5 or PHP 7.1. I'll not be starting to use this package until later in the week, but will let you know how it goes.

judgej commented 6 years ago

Just tried this on Laravel 5.6, and it is working for me beautifully. It was so smooth, I though that maybe I hadn't switched over from the database queue driver, but I had. Thank you.

judgej commented 6 years ago

Totally off-topic, but as you are using Azure stuff, you may be interested in this package I knocked up over the weekend to support an Azure File Storage share as a Laravel filesystem (it's a filesystem driver):

https://github.com/academe/laravel-azure-file-storage-driver

(I don't normally self-promote like that, but if you are doing Laravel+Azure, it's a missing piece you may find useful. But just delete this comment if I'm over-reaching.)