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

Lcobucci\JWT\Signer\Key\InMemory::plainText(): Argument #1 ($contents) must #21 10.08 be of type string, null given #116

Closed
Messhias opened this issue Feb 2, 2022 · 2 comments · Fixed by #123
Labels
bug Something isn't working

Comments

@Messhias
Copy link
Collaborator

Messhias commented Feb 2, 2022

Subject of the issue

Lcobucci has stopped working in docker PHP alpine 8+

Your environment:

Q A
Bug? yes
New Feature? no
Framework Laravel / Lumen
Framework version latest
Package version latest
PHP version latest

Steps to reproduce

Dockerfile:

FROM php:8-fpm-alpine3.13
ENV \
  COMPOSER_ALLOW_SUPERUSER=1 \
  PHP_EXTENSIONS="bcmath bz2 calendar exif gd gettext gmp imap intl ldap mysqli pcntl pdo_mysql pgsql pdo_pgsql \
    soap sockets swoole swoole_async sysvshm sysvmsg sysvsem tidy zip zephir_parser"

# set up the UK timezone as well.
ENV TZ=Europe/London
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN \
# deps
#  adduser
  addgroup -S app \
  && adduser -S -D -h /var/www app app \
  && apk add -U --no-cache --virtual temp \
    # dev deps
    autoconf g++ nginx file supervisor git re2c make zlib-dev libtool pcre-dev libxml2-dev bzip2-dev libzip-dev \
      icu-dev gettext-dev imagemagick-dev openldap-dev libpng-dev gmp-dev yaml-dev postgresql-dev \
      libxml2-dev tidyhtml-dev libmemcached-dev libssh2-dev libevent-dev libev-dev lua-dev \
      autoconf automake make gcc g++ \
    # prod deps
    && apk add --no-cache icu gettext imagemagick libzip libbz2 libxml2-utils openldap-back-mdb openldap yaml \
      libpq tidyhtml imap-dev libmemcached libssh2 libevent libev lua zip \
# php extensions
  && docker-php-source extract \
    && pecl channel-update pecl.php.net \
    && pecl install $PECL_EXTENSIONS \
    && cd /usr/src/php/ext/ \
    && for BUNDLE_EXT in $PECL_BUNDLE; do pecl bundle $BUNDLE_EXT; done \
    && docker-php-ext-enable $(echo $PECL_EXTENSIONS | sed -E 's/\-[^ ]+//g') opcache

RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
  docker-php-ext-configure gd && \
  NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
  docker-php-ext-install -j${NPROC} gd && \
  apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev

RUN docker-php-ext-install pdo pdo_pgsql
RUN docker-php-ext-install zip

# REDIS EXTENSION
RUN pecl install -o -f redis \
    && rm -rf /tmp/pear \
    && docker-php-ext-enable redis

# INSTALL XDEBUG
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug

# install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# COPY Code and Config File
COPY . /var/www
WORKDIR /var/www

#USER app
EXPOSE 80
RUN composer install --ignore-platform-reqs --optimize-autoloader --no-dev \
    && chown -R app:app /var/www
RUN chown -R www-data:www-data /var/www
RUN chown -R $USER:www-data /var/www/storage
RUN mkdir -p /var/www/storage/framework/cache/laravel-excel
RUN chown -R $USER:www-data /var/www/storage/framework/cache/laravel-excel
RUN chown -R $USER:www-data /var/www/bootstrap/cache
RUN chown -R $USER:www-data /var/www
RUN chmod -R 777 ./storage

ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]

Just run docker build -t . locally and see.

Expected behavior

Package has been installed

Actual behavior

The problem is mistyping from interfaces, I know the package is not ready yet to support 8+ since this is still on the discussion on #76, but I believe it's. time to think forward. We cannot ask to users downgrade PHP versions just because someone didn't upgrade their versions, move forward always not backward.

additional log docker information.

[+] Building 12.8s (21/28)                                                                                          
 => [internal] load build definition from Dockerfile                                                           0.0s
 => => transferring dockerfile: 2.88kB                                                                         0.0s
 => [internal] load .dockerignore                                                                              0.0s
 => => transferring context: 35B                                                                               0.0s
 => [internal] load metadata for docker.io/library/php:8-fpm-alpine3.13                                        1.4s
 => FROM docker.io/library/composer:latest                                                                     0.0s
 => [stage-0  1/23] FROM docker.io/library/php:8-fpm-alpine3.13@sha256:8f8b5caff17287c12f34e43e1559aac1866f08  0.0s
 => [internal] load build context                                                                              0.4s
 => => transferring context: 371.23kB                                                                          0.1s
 => CACHED [stage-0  2/23] RUN ln -snf /usr/share/zoneinfo/Europe/London /etc/localtime && echo Europe/London  0.0s
 => CACHED [stage-0  3/23] RUN   addgroup -S app   && adduser -S -D -h /var/www app app   && apk add -U --no-  0.0s
 => CACHED [stage-0  4/23] RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjp  0.0s
 => CACHED [stage-0  5/23] RUN docker-php-ext-install pdo pdo_pgsql                                            0.0s
 => CACHED [stage-0  6/23] RUN docker-php-ext-install zip                                                      0.0s
 => CACHED [stage-0  7/23] RUN pecl install -o -f redis     && rm -rf /tmp/pear     && docker-php-ext-enable   0.0s
 => CACHED [stage-0  8/23] RUN pecl install xdebug                                                             0.0s
 => CACHED [stage-0  9/23] RUN docker-php-ext-enable xdebug                                                    0.0s
 => CACHED [stage-0 10/23] COPY --from=composer:latest /usr/bin/composer /usr/bin/composer                     0.0s
 => [stage-0 11/23] COPY . /var/www                                                                            0.5s
 => [stage-0 12/23] COPY ./docker/app.conf /usr/local/etc/php-fpm.d/app.conf                                   0.0s
 => [stage-0 13/23] COPY ./docker/default.conf /etc/nginx/conf.d/default.conf                                  0.0s
 => [stage-0 14/23] COPY ./docker/supervisord.conf /etc/supervisord.conf                                       0.0s
 => [stage-0 15/23] WORKDIR /var/www                                                                           0.0s
 => ERROR [stage-0 16/23] RUN composer install --ignore-platform-reqs --optimize-autoloader --no-dev     &&   10.3s
------                                                                                                              
 > [stage-0 16/23] RUN composer install --ignore-platform-reqs --optimize-autoloader --no-dev     && chown -R app:app /var/www:                                                                                                         
#21 0.286 Installing dependencies from lock file                                                                    
#21 0.290 Verifying lock file contents can be installed on current platform.                                        
#21 0.300 Package operations: 122 installs, 0 updates, 0 removals                                                   
#21 0.301   - Downloading aws/aws-crt-php (v1.0.2)
#21 0.302   - Downloading voku/portable-ascii (1.6.1)
#21 0.302   - Downloading symfony/polyfill-php80 (v1.24.0)
#21 0.302   - Downloading symfony/polyfill-mbstring (v1.24.0)
#21 0.302   - Downloading symfony/polyfill-ctype (v1.24.0)
#21 0.303   - Downloading phpoption/phpoption (1.8.1)
#21 0.303   - Downloading graham-campbell/result-type (v1.0.4)
#21 0.303   - Downloading vlucas/phpdotenv (v5.4.1)
#21 0.303   - Downloading symfony/css-selector (v5.4.3)
#21 0.304   - Downloading tijsverkoyen/css-to-inline-styles (2.2.4)
#21 0.304   - Downloading symfony/var-dumper (v5.4.3)
#21 0.304   - Downloading symfony/deprecation-contracts (v3.0.0)
#21 0.304   - Downloading symfony/routing (v5.4.3)
#21 0.304   - Downloading symfony/process (v5.4.3)
#21 0.304   - Downloading symfony/polyfill-php72 (v1.24.0)
#21 0.304   - Downloading symfony/polyfill-intl-normalizer (v1.24.0)
#21 0.304   - Downloading symfony/polyfill-intl-idn (v1.24.0)
#21 0.305   - Downloading symfony/mime (v5.4.3)
#21 0.305   - Downloading symfony/polyfill-php73 (v1.24.0)
#21 0.305   - Downloading symfony/http-foundation (v5.4.3)
#21 0.305   - Downloading psr/event-dispatcher (1.0.0)
#21 0.305   - Downloading symfony/event-dispatcher-contracts (v3.0.0)
#21 0.305   - Downloading symfony/event-dispatcher (v6.0.3)
#21 0.305   - Downloading psr/log (2.0.0)
#21 0.305   - Downloading symfony/error-handler (v5.4.3)
#21 0.305   - Downloading symfony/http-kernel (v5.4.4)
#21 0.305   - Downloading symfony/finder (v5.4.3)
#21 0.306   - Downloading symfony/polyfill-intl-grapheme (v1.24.0)
#21 0.306   - Downloading symfony/string (v6.0.3)
#21 0.306   - Downloading psr/container (1.1.2)
#21 0.306   - Downloading symfony/service-contracts (v2.4.1)
#21 0.306   - Downloading symfony/console (v5.4.3)
#21 0.306   - Downloading symfony/polyfill-iconv (v1.24.0)
#21 0.306   - Downloading doctrine/lexer (1.2.2)
#21 0.307   - Downloading egulias/email-validator (2.1.25)
#21 0.307   - Downloading swiftmailer/swiftmailer (v6.3.0)
#21 0.307   - Downloading symfony/polyfill-php81 (v1.24.0)
#21 0.307   - Downloading ramsey/collection (1.2.2)
#21 0.307   - Downloading brick/math (0.9.3)
#21 0.307   - Downloading ramsey/uuid (4.2.3)
#21 0.307   - Downloading psr/simple-cache (1.0.1)
#21 0.308   - Downloading opis/closure (3.6.3)
#21 0.308   - Downloading symfony/translation-contracts (v3.0.0)
#21 0.308   - Downloading symfony/translation (v6.0.3)
#21 0.308   - Downloading nesbot/carbon (2.56.0)
#21 0.308   - Downloading monolog/monolog (2.3.5)
#21 0.308   - Downloading league/mime-type-detection (1.9.0)
#21 0.308   - Downloading league/flysystem (1.1.9)
#21 0.309   - Downloading nette/utils (v3.2.7)
#21 0.309   - Downloading nette/schema (v1.2.2)
#21 0.309   - Downloading dflydev/dot-access-data (v3.0.1)
#21 0.309   - Downloading league/config (v1.1.1)
#21 0.309   - Downloading league/commonmark (2.2.1)
#21 0.309   - Downloading laravel/serializable-closure (v1.1.0)
#21 0.309   - Downloading webmozart/assert (1.10.0)
#21 0.309   - Downloading dragonmantank/cron-expression (v3.3.1)
#21 0.309   - Downloading doctrine/inflector (2.0.4)
#21 0.309   - Downloading laravel/framework (v8.82.0)
#21 0.310   - Downloading mtdowling/jmespath.php (2.6.1)
#21 0.310   - Downloading ralouphie/getallheaders (3.0.3)
#21 0.310   - Downloading psr/http-message (1.0.1)
#21 0.310   - Downloading psr/http-factory (1.0.1)
#21 0.310   - Downloading guzzlehttp/psr7 (2.1.0)
#21 0.310   - Downloading guzzlehttp/promises (1.5.1)
#21 0.310   - Downloading psr/http-client (1.0.1)
#21 0.311   - Downloading guzzlehttp/guzzle (7.4.1)
#21 0.311   - Downloading aws/aws-sdk-php (3.209.15)
#21 0.311   - Downloading aws/aws-sdk-php-laravel (3.6.0)
#21 0.311   - Downloading symfony/yaml (v5.4.3)
#21 0.311   - Downloading psr/cache (3.0.0)
#21 0.311   - Downloading doctrine/annotations (1.13.2)
#21 0.311   - Downloading zircote/swagger-php (3.3.3)
#21 0.311   - Downloading swagger-api/swagger-ui (v3.52.5)
#21 0.312   - Downloading darkaonline/l5-swagger (8.1.0)
#21 0.312   - Downloading doctrine/event-manager (1.1.1)
#21 0.312   - Downloading doctrine/deprecations (v0.5.3)
#21 0.312   - Downloading doctrine/cache (2.1.1)
#21 0.312   - Downloading doctrine/dbal (3.3.1)
#21 0.312   - Downloading facade/ignition-contracts (1.0.2)
#21 0.312   - Downloading facade/flare-client-php (1.9.1)
#21 0.312   - Downloading facade/ignition (2.17.4)
#21 0.313   - Downloading fideloper/proxy (4.4.1)
#21 0.313   - Downloading asm89/stack-cors (v2.1.1)
#21 0.313   - Downloading fruitcake/laravel-cors (v2.0.5)
#21 0.313   - Downloading goetas-webservices/xsd-reader (0.3.9)
#21 0.313   - Downloading intervention/image (2.7.1)
#21 0.313   - Downloading laravel/telescope (v4.7.1)
#21 0.313   - Downloading nikic/php-parser (v4.13.2)
#21 0.314   - Downloading psy/psysh (v0.11.1)
#21 0.314   - Downloading laravel/tinker (v2.7.0)
#21 0.314   - Downloading lcobucci/clock (2.1.0)
#21 0.314   - Downloading league/flysystem-aws-s3-v3 (1.0.29)
#21 0.314   - Downloading markbaker/matrix (3.0.0)
#21 0.314   - Downloading markbaker/complex (3.0.1)
#21 0.314   - Downloading myclabs/php-enum (1.8.3)
#21 0.315   - Downloading maennchen/zipstream-php (2.1.0)
#21 0.315   - Downloading ezyang/htmlpurifier (v4.14.0)
#21 0.315   - Downloading phpoffice/phpspreadsheet (1.21.0)
#21 0.315   - Downloading maatwebsite/excel (3.1.35)
#21 0.315   - Downloading hamcrest/hamcrest-php (v2.0.1)
#21 0.315   - Downloading mockery/mockery (1.5.0)
#21 0.316   - Downloading umpirsky/country-list (2.0.6)
#21 0.316   - Downloading monarobase/country-list (3.2.0)
#21 0.316   - Downloading owen-it/laravel-auditing (12.1.0)
#21 0.316   - Downloading paragonie/random_compat (v9.99.100)
#21 0.316   - Downloading namshi/jose (7.2.3)
#21 0.316   - Downloading lcobucci/jwt (4.1.5)
#21 0.316   - Downloading php-open-source-saver/jwt-auth (1.4.1)
#21 0.317   - Downloading predis/predis (v1.1.10)
#21 0.317   - Downloading paragonie/sodium_compat (v1.17.0)
#21 0.317   - Downloading pusher/pusher-php-server (7.0.2)
#21 0.317   - Downloading s-ichikawa/laravel-sendgrid-driver (3.0.4)
#21 0.317   - Downloading scotteh/php-dom-wrapper (2.0.1)
#21 0.317   - Downloading jakeasmith/http_build_url (1.0.1)
#21 0.318   - Downloading scotteh/php-goose (1.1.0)
#21 0.318   - Downloading mailjet/mailjet-apiv3-php (v1.5.5)
#21 0.318   - Downloading mailjet/mailjet-swiftmailer (2.0.0)
#21 0.318   - Downloading thedoctor0/laravel-mailjet-driver (1.0.3)
#21 0.318   - Downloading twilio/sdk (6.33.1)
#21 0.318   - Downloading voku/portable-utf8 (6.0.1)
#21 0.318   - Downloading voku/simple_html_dom (4.8.0)
#21 0.356    0/121 [>---------------------------]   0%
#21 1.031    5/121 [=>--------------------------]   4%
#21 1.145   12/121 [==>-------------------------]   9%
#21 1.245   16/121 [===>------------------------]  13%
#21 1.372   23/121 [=====>----------------------]  19%
#21 1.500   30/121 [======>---------------------]  24%
#21 1.602   35/121 [========>-------------------]  28%
#21 1.717   40/121 [=========>------------------]  33%
#21 1.837   45/121 [==========>-----------------]  37%
#21 1.947   50/121 [===========>----------------]  41%
#21 2.065   55/121 [============>---------------]  45%
#21 2.189   62/121 [==============>-------------]  51%
#21 2.292   65/121 [===============>------------]  53%
#21 2.393   70/121 [================>-----------]  57%
#21 2.499   75/121 [=================>----------]  61%
#21 2.599   80/121 [==================>---------]  66%
#21 2.707   85/121 [===================>--------]  70%
#21 2.823   88/121 [====================>-------]  72%
#21 2.945   97/121 [======================>-----]  80%
#21 3.063  100/121 [=======================>----]  82%
#21 3.207  104/121 [========================>---]  85%
#21 3.313  108/121 [========================>---]  89%
#21 3.413  109/121 [=========================>--]  90%
#21 3.516  110/121 [=========================>--]  90%
#21 3.617  115/121 [==========================>-]  95%
#21 3.721  118/121 [===========================>]  97%
#21 3.825  119/121 [===========================>]  98%
#21 3.929  120/121 [===========================>]  99%
#21 5.906  121/121 [============================] 100%
#21 5.907   - Installing aws/aws-crt-php (v1.0.2): Extracting archive
#21 5.909   - Installing voku/portable-ascii (1.6.1): Extracting archive
#21 5.911   - Installing symfony/polyfill-php80 (v1.24.0): Extracting archive
#21 5.912   - Installing symfony/polyfill-mbstring (v1.24.0): Extracting archive
#21 5.913   - Installing symfony/polyfill-ctype (v1.24.0): Extracting archive
#21 5.915   - Installing phpoption/phpoption (1.8.1): Extracting archive
#21 5.917   - Installing graham-campbell/result-type (v1.0.4): Extracting archive
#21 5.919   - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
#21 5.921   - Installing symfony/css-selector (v5.4.3): Extracting archive
#21 5.922   - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
#21 5.924   - Installing symfony/var-dumper (v5.4.3): Extracting archive
#21 5.924   - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
#21 5.925   - Installing symfony/routing (v5.4.3): Extracting archive
#21 5.925   - Installing symfony/process (v5.4.3): Extracting archive
#21 5.926   - Installing symfony/polyfill-php72 (v1.24.0): Extracting archive
#21 5.926   - Installing symfony/polyfill-intl-normalizer (v1.24.0): Extracting archive
#21 5.927   - Installing symfony/polyfill-intl-idn (v1.24.0): Extracting archive
#21 5.927   - Installing symfony/mime (v5.4.3): Extracting archive
#21 5.928   - Installing symfony/polyfill-php73 (v1.24.0): Extracting archive
#21 5.928   - Installing symfony/http-foundation (v5.4.3): Extracting archive
#21 5.929   - Installing psr/event-dispatcher (1.0.0): Extracting archive
#21 5.929   - Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
#21 5.930   - Installing symfony/event-dispatcher (v6.0.3): Extracting archive
#21 5.930   - Installing psr/log (2.0.0): Extracting archive
#21 5.930   - Installing symfony/error-handler (v5.4.3): Extracting archive
#21 5.931   - Installing symfony/http-kernel (v5.4.4): Extracting archive
#21 5.931   - Installing symfony/finder (v5.4.3): Extracting archive
#21 5.931   - Installing symfony/polyfill-intl-grapheme (v1.24.0): Extracting archive
#21 5.932   - Installing symfony/string (v6.0.3): Extracting archive
#21 5.932   - Installing psr/container (1.1.2): Extracting archive
#21 5.932   - Installing symfony/service-contracts (v2.4.1): Extracting archive
#21 5.932   - Installing symfony/console (v5.4.3): Extracting archive
#21 5.933   - Installing symfony/polyfill-iconv (v1.24.0): Extracting archive
#21 5.933   - Installing doctrine/lexer (1.2.2): Extracting archive
#21 5.934   - Installing egulias/email-validator (2.1.25): Extracting archive
#21 5.934   - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
#21 5.934   - Installing symfony/polyfill-php81 (v1.24.0): Extracting archive
#21 5.934   - Installing ramsey/collection (1.2.2): Extracting archive
#21 5.934   - Installing brick/math (0.9.3): Extracting archive
#21 5.935   - Installing ramsey/uuid (4.2.3): Extracting archive
#21 5.935   - Installing psr/simple-cache (1.0.1): Extracting archive
#21 5.935   - Installing opis/closure (3.6.3): Extracting archive
#21 5.935   - Installing symfony/translation-contracts (v3.0.0): Extracting archive
#21 5.935   - Installing symfony/translation (v6.0.3): Extracting archive
#21 5.936   - Installing nesbot/carbon (2.56.0): Extracting archive
#21 5.936   - Installing monolog/monolog (2.3.5): Extracting archive
#21 5.936   - Installing league/mime-type-detection (1.9.0): Extracting archive
#21 5.936   - Installing league/flysystem (1.1.9): Extracting archive
#21 5.936   - Installing nette/utils (v3.2.7): Extracting archive
#21 5.937   - Installing nette/schema (v1.2.2): Extracting archive
#21 5.937   - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
#21 5.937   - Installing league/config (v1.1.1): Extracting archive
#21 5.937   - Installing league/commonmark (2.2.1): Extracting archive
#21 5.937   - Installing laravel/serializable-closure (v1.1.0): Extracting archive
#21 5.938   - Installing webmozart/assert (1.10.0): Extracting archive
#21 5.938   - Installing dragonmantank/cron-expression (v3.3.1): Extracting archive
#21 5.938   - Installing doctrine/inflector (2.0.4): Extracting archive
#21 5.938   - Installing laravel/framework (v8.82.0): Extracting archive
#21 5.938   - Installing mtdowling/jmespath.php (2.6.1): Extracting archive
#21 5.939   - Installing ralouphie/getallheaders (3.0.3): Extracting archive
#21 5.939   - Installing psr/http-message (1.0.1): Extracting archive
#21 5.939   - Installing psr/http-factory (1.0.1): Extracting archive
#21 5.939   - Installing guzzlehttp/psr7 (2.1.0): Extracting archive
#21 5.939   - Installing guzzlehttp/promises (1.5.1): Extracting archive
#21 5.939   - Installing psr/http-client (1.0.1): Extracting archive
#21 5.940   - Installing guzzlehttp/guzzle (7.4.1): Extracting archive
#21 5.940   - Installing aws/aws-sdk-php (3.209.15): Extracting archive
#21 5.940   - Installing aws/aws-sdk-php-laravel (3.6.0): Extracting archive
#21 5.940   - Installing symfony/yaml (v5.4.3): Extracting archive
#21 5.940   - Installing psr/cache (3.0.0): Extracting archive
#21 5.941   - Installing doctrine/annotations (1.13.2): Extracting archive
#21 5.941   - Installing zircote/swagger-php (3.3.3): Extracting archive
#21 5.941   - Installing swagger-api/swagger-ui (v3.52.5): Extracting archive
#21 5.941   - Installing darkaonline/l5-swagger (8.1.0): Extracting archive
#21 5.941   - Installing doctrine/event-manager (1.1.1): Extracting archive
#21 5.942   - Installing doctrine/deprecations (v0.5.3): Extracting archive
#21 5.942   - Installing doctrine/cache (2.1.1): Extracting archive
#21 5.942   - Installing doctrine/dbal (3.3.1): Extracting archive
#21 5.942   - Installing facade/ignition-contracts (1.0.2): Extracting archive
#21 5.943   - Installing facade/flare-client-php (1.9.1): Extracting archive
#21 5.943   - Installing facade/ignition (2.17.4): Extracting archive
#21 5.943   - Installing fideloper/proxy (4.4.1): Extracting archive
#21 5.943   - Installing asm89/stack-cors (v2.1.1): Extracting archive
#21 5.943   - Installing fruitcake/laravel-cors (v2.0.5): Extracting archive
#21 5.943   - Installing goetas-webservices/xsd-reader (0.3.9): Extracting archive
#21 5.943   - Installing intervention/image (2.7.1): Extracting archive
#21 5.944   - Installing laravel/telescope (v4.7.1): Extracting archive
#21 5.944   - Installing nikic/php-parser (v4.13.2): Extracting archive
#21 5.944   - Installing psy/psysh (v0.11.1): Extracting archive
#21 5.944   - Installing laravel/tinker (v2.7.0): Extracting archive
#21 5.944   - Installing lcobucci/clock (2.1.0): Extracting archive
#21 5.945   - Installing league/flysystem-aws-s3-v3 (1.0.29): Extracting archive
#21 5.945   - Installing markbaker/matrix (3.0.0): Extracting archive
#21 5.945   - Installing markbaker/complex (3.0.1): Extracting archive
#21 5.945   - Installing myclabs/php-enum (1.8.3): Extracting archive
#21 5.945   - Installing maennchen/zipstream-php (2.1.0): Extracting archive
#21 5.945   - Installing ezyang/htmlpurifier (v4.14.0): Extracting archive
#21 5.946   - Installing phpoffice/phpspreadsheet (1.21.0): Extracting archive
#21 5.946   - Installing maatwebsite/excel (3.1.35): Extracting archive
#21 5.946   - Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
#21 5.946   - Installing mockery/mockery (1.5.0): Extracting archive
#21 5.946   - Installing umpirsky/country-list (2.0.6): Extracting archive
#21 5.947   - Installing monarobase/country-list (3.2.0): Extracting archive
#21 5.947   - Installing owen-it/laravel-auditing (12.1.0): Extracting archive
#21 5.947   - Installing paragonie/random_compat (v9.99.100): Extracting archive
#21 5.947   - Installing symfony/polyfill-php56 (v1.20.0)
#21 5.948   - Installing namshi/jose (7.2.3): Extracting archive
#21 5.948   - Installing lcobucci/jwt (4.1.5): Extracting archive
#21 5.948   - Installing php-open-source-saver/jwt-auth (1.4.1): Extracting archive
#21 5.948   - Installing predis/predis (v1.1.10): Extracting archive
#21 5.949   - Installing paragonie/sodium_compat (v1.17.0): Extracting archive
#21 5.949   - Installing pusher/pusher-php-server (7.0.2): Extracting archive
#21 5.949   - Installing s-ichikawa/laravel-sendgrid-driver (3.0.4): Extracting archive
#21 5.949   - Installing scotteh/php-dom-wrapper (2.0.1): Extracting archive
#21 5.949   - Installing jakeasmith/http_build_url (1.0.1): Extracting archive
#21 5.949   - Installing scotteh/php-goose (1.1.0): Extracting archive
#21 5.950   - Installing mailjet/mailjet-apiv3-php (v1.5.5): Extracting archive
#21 5.950   - Installing mailjet/mailjet-swiftmailer (2.0.0): Extracting archive
#21 5.950   - Installing thedoctor0/laravel-mailjet-driver (1.0.3): Extracting archive
#21 5.950   - Installing twilio/sdk (6.33.1): Extracting archive
#21 5.950   - Installing voku/portable-utf8 (6.0.1): Extracting archive
#21 5.951   - Installing voku/simple_html_dom (4.8.0): Extracting archive
#21 5.960    0/121 [>---------------------------]   0%
#21 5.978   10/121 [==>-------------------------]   8%
#21 6.081   32/121 [=======>--------------------]  26%
#21 6.184   54/121 [============>---------------]  44%
#21 6.284   70/121 [================>-----------]  57%
#21 6.384   83/121 [===================>--------]  68%
#21 6.486   94/121 [=====================>------]  77%
#21 6.589   99/121 [======================>-----]  81%
#21 6.694  111/121 [=========================>--]  91%
#21 6.794  119/121 [===========================>]  98%
#21 6.994  120/121 [===========================>]  99%
#21 7.484  121/121 [============================] 100%
#21 7.748 Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
#21 7.748 Generating optimized autoload files
#21 9.811 > Illuminate\Foundation\ComposerScripts::postAutoloadDump
#21 9.829 > @php artisan package:discover --ansi
#21 10.07 
#21 10.08 In InMemory.php line 30:
#21 10.08                                                                                
#21 10.08   Lcobucci\JWT\Signer\Key\InMemory::plainText(): Argument #1 ($contents) must  
#21 10.08    be of type string, null given, called in /var/www/vendor/php-open-source-s  
#21 10.08   aver/jwt-auth/src/Providers/JWT/Lcobucci.php on line 88                      
#21 10.08                                                                                
#21 10.08 
#21 10.08 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c composer install --ignore-platform-reqs --optimize-autoloader --no-dev     && chown -R app:app /var/www]: exit code: 1
@Messhias Messhias added the bug Something isn't working label Feb 2, 2022
@mfn
Copy link
Contributor

mfn commented Feb 2, 2022

But this is the same as #111 ?

IMHO it means:

  • you've an symmetric algo (the default is HS256 which is symmetric)
  • but no JWT_SECRET defined in your .env

Example on a bare bones project, where I disabled the JWT_SECRET:

+ $ grep JWT_SECRET .env
#JWT_SECRET=ZIPSZBrNx2liNWbw6BZ6nZGN82LwJdNPynE9L7lyV0vgajlse0oxzaXCePLplukn
⏱  2022-02-02 21:26:43 📁 ~/tmp/jwt-auth-issue-116
+ $ ./artisan tinker
Psy Shell v0.11.1 (PHP 8.1.2 — cli) by Justin Hileman
>>> $jwt = app('tymon.jwt.provider.jwt');
TypeError: Lcobucci\JWT\Signer\Key\InMemory::plainText(): Argument #1 ($contents) must be of type string, null given, called in /vendor/php-open-source-saver/jwt-auth/src/Providers/JWT/Lcobucci.php on line 91

Make sure a secret is defined, and it's good:

+ $ grep JWT_SECRET .env
JWT_SECRET=ZIPSZBrNx2liNWbw6BZ6nZGN82LwJdNPynE9L7lyV0vgajlse0oxzaXCePLplukn
⏱  2022-02-02 21:28:57 📁 ~/tmp/jwt-auth-issue-116
+ $ ./artisan tinker
Psy Shell v0.11.1 (PHP 8.1.2 — cli) by Justin Hileman
>>> $jwt = app('tymon.jwt.provider.jwt');
=> PHPOpenSourceSaver\JWTAuth\Providers\JWT\Lcobucci {#3538}
>>>

What am I missing? Why would this be related for PHP 8+ only roadmap etc.? 🤔

@eschricker
Copy link
Contributor

I can confirm that this is the behaviour, when JWT_SECRET is not set in the .env-file.

One simple solution would be to add an empty string as default value to the config-file.

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | JWT Authentication Secret
    |--------------------------------------------------------------------------
    |
    | Don't forget to set this in your .env file, as it will be used to sign
    | your tokens. A helper command is provided for this:
    | `php artisan jwt:secret`
    |
    | Note: This will be used for Symmetric algorithms only (HMAC),
    | since RSA and ECDSA use a private/public key combo (See below).
    |
    */

    'secret' => env('JWT_SECRET', ''),
...

But it needs to be checked if it has some side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants