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

Argument #8 ($subjectAlternativeNames) must be of type array, null given #28

Closed
lucasdcrk opened this issue Feb 4, 2023 · 3 comments
Closed

Comments

@lucasdcrk
Copy link

lucasdcrk commented Feb 4, 2023

Hi,

Thanks for providing this package!

After upgrading to 0.5.1 I encounter the following type error when trying to generating any SSL certificate:

Daanra\LaravelLetsEncrypt\AcmePhp\Ssl\DistinguishedName::__construct(): Argument #8 ($subjectAlternativeNames) must be of type array, null given, called in /home/netweak-prod/htdocs/netweak.com/vendor/daanra/laravel-lets-encrypt/src/Jobs/RequestCertificate.php on line 4

Using
LetsEncrypt::certificate('mydomain.com')->create();

Also tried without success either:
LetsEncrypt::certificate('mydomain.com')->setSubjectAlternativeNames([])->create();

Any idea where it would come from?

Regards,
Lucas

@lucasdcrk
Copy link
Author

Seems to be a migration issue, for anyone looking
When you upgrade to >5.0 on your existing installation
run php artisan vendor:publish
and select Laravel Letsencrypt package to publish the new migrations

@jayo-exe
Copy link

I'm have a similar issue as above. I needed to remove the ->default('[]') from the migration that adds the new subject_alternative_names field, due to the fact that Laravel disallows default values on JSON fields and the migration failed to process as long as this was in place.

This allows the migration to run, but causes new records in the database to pre-populate this field with null, causing the error as described above.

@dyoh777
Copy link

dyoh777 commented Mar 31, 2024

I had a similar issue and it wasn't apparent where the issue was, the new migration solved my problem too.

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

3 participants