diff --git a/core/lib/Drupal/Core/Path/PathAliasStorage.php b/core/lib/Drupal/Core/Path/PathAliasStorage.php
index a9db234c458d047296a3621b9a202dec4bb8110a..ed765accbcd4b56fcfa2983299b4eb261aed38aa 100644
--- a/core/lib/Drupal/Core/Path/PathAliasStorage.php
+++ b/core/lib/Drupal/Core/Path/PathAliasStorage.php
@@ -43,7 +43,8 @@ protected function invokeHook($hook, EntityInterface $entity) {
    */
   public function createWithSampleValues($bundle = FALSE, array $values = []) {
     $entity = parent::createWithSampleValues($bundle, ['path' => '/<front>'] + $values);
-    $entity->set('alias', '/' . $entity->get('alias')->value);
+    // Ensure the alias is only 255 characters long.
+    $entity->set('alias', substr('/' . $entity->get('alias')->value, 0, 255));
     return $entity;
   }