shlinkio / shlink

The definitive self-hosted URL shortener
https://shlink.io
MIT License
3.32k stars 271 forks source link

YOURLS Import: INVALID_PORT #2106

Closed jaredcat closed 6 months ago

jaredcat commented 7 months ago

Shlink version

4.1.0

PHP version

8.2

How do you serve Shlink

Self-hosted RoadRunner

Database engine

SQLite

Database version

3.40.0

Current behavior

Importing from YOURLS 1.9.2 All my imports fail with this error:

Stack trace:
#0 /opt/shlink/module/Core/src/Exception/ValidationException.php(31): Shlinkio\Shlink\Core\Exception\ValidationException::fromArray()
#1 /opt/shlink/module/Core/src/ShortUrl/Model/ShortUrlCreation.php(53): Shlinkio\Shlink\Core\Exception\ValidationException::fromInputFilter()
#2 /opt/shlink/module/Core/src/ShortUrl/Entity/ShortUrl.php(128): Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation::fromRawData()
#3 /opt/shlink/module/Core/src/Importer/ImportedLinksProcessor.php(103): Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl::fromImport()
#4 /opt/shlink/module/Core/src/Importer/ImportedLinksProcessor.php(69): Shlinkio\Shlink\Core\Importer\ImportedLinksProcessor->resolveShortUrl()
#5 /opt/shlink/module/Core/src/Importer/ImportedLinksProcessor.php(41): Shlinkio\Shlink\Core\Importer\ImportedLinksProcessor->importShortUrls()
#6 /opt/shlink/vendor/shlinkio/shlink-importer/src/Command/ImportCommand.php(84): Shlinkio\Shlink\Core\Importer\ImportedLinksProcessor->process()
#7 /opt/shlink/vendor/symfony/console/Command/Command.php(279): Shlinkio\Shlink\Importer\Command\ImportCommand->execute()
#8 /opt/shlink/vendor/symfony/console/Application.php(1031): Symfony\Component\Console\Command\Command->run()
#9 /opt/shlink/vendor/symfony/console/Application.php(318): Symfony\Component\Console\Application->doRunCommand()
#10 /opt/shlink/vendor/symfony/console/Application.php(169): Symfony\Component\Console\Application->doRun()
#11 /opt/shlink/bin/cli(10): Symfony\Component\Console\Application->run()
#12 {main}
 https://ts.la/jared914318 : Skipped. Reason: Provided data is not valid.
 Shlinkio\Shlink\Core\Exception\ValidationException Provided data is not valid in /opt/shlink/module/Core/src/Exception/ValidationException.php:37
    'domain' => Array
(
    [INVALID_PORT] => The port part of the value is not valid. Must be a number between 1 and 65535
)

Expected behavior

Successfully import all my YOURL urls

Minimum steps to reproduce

I just set up this shlink instance. Installed and activated the plugin on YOURLS. Ran bin/cli short-url:import yourls -v

jaredcat commented 7 months ago

I commented out this line as a workaround for now https://github.com/shlinkio/shlink/blob/e586fec338571903b2d2330a5bc44526bdcb37e4/module/Core/src/ShortUrl/Model/Validation/ShortUrlInputFilter.php#L87

acelaya commented 7 months ago

Can you share some of the URLs which are causing this validation error?

If you try to manually create the short URL in Shlink, does it throw the same error?

acelaya commented 6 months ago

Closing for now as non-reproducible. I'm happy to reopen when all the information to reproduce has been provided.