Upgrade Problems ("page is currently offline" and "internal server error")

Hey,

I wanted to update my blog (really simple site) from kirby2 to kirby3 and followed the instructions. I used the plainkit for replacing the folders.
When I did all the steps I got this error. Everything except the upgrade script which threw the same error.

This page is currently offline. We are very sorry for the inconvenience and will fix it as soon as possible.

Advice for developers and administrators:
Change the PHP version to 7.3, 7.4 or 8.0 (PHP 7.4 is recommended)

The debug mode didnt work, so I thought I update the php version to 7.4. When I did this I got an 500 internal server error. all other sites on my webspace are still functional.
Maybe someone can help me.

Best regards.
Maurice

Is the 500 error caused when you run the upgrade script or when you open the site normally? Or both?

What you can do if the upgrade script does not run, is put the code into a route in your config.

It is caoused when i run the site normally.

What I already did is replacing the “-” with"_" by hand.

Oh! Hope you didn’t have to rename too many pages manually.

Aee you doing this update on a remote server? I think it would be much better to do this locally in a dev enviroment where it’s easier to debug.

Yes that was managable :slight_smile:

I repeated the steps locally (the script worked there :slight_smile: )
Including step 4. (I think the following steps are not relevant for my project)

In my local environment I only get 500 too :frowning:

Hm, anything in your console? What is your local environment?

Have you tried using a different PHP version?

I used MAMP on my machine (PHP 7.3.8) and PHP 7.4 on the remote server.

I use VSCode and can’t see any errors so far. As I said I can’t run debug mode. There’s only a 500 server error. :frowning:

Edit:
I updated my mamp and now it’s running on PHP 7.4.12
I can now open the panel and can see some pages there except my blog entries. I can find them via the panel search but can’t see them if I click on my “Blog page” in the panel.

Also the debugger shows up and throws 24 errors. Amongst others this one:

Whoops\Exception\ErrorException thrown with message "Invalid argument supplied for foreach()"

for this code:

<nav role="navigation">
 
  <ul class="menu cf">
    <?php foreach($pages->visible() as $p): ?>
    <li>
      <a  <?php e($p->isOpen(), ' class="active"') ?> href="<?php echo $p->url() ?>"><?php echo $p->title()->html() ?> </a>
    </li>
    <?php endforeach ?>
  </ul>
 
</nav>

If I delete the part above the followong two errors show up:

This error:
Error thrown with message "Call to a member function paginate() on null"

for this code:

<ul class="teaser cf">
      <?php foreach($articles as $project): ?>
     
      <li>
        <h3><a href="<?php echo $project->url() ?>"><?php echo $project->title()->html() ?></a></h3>
        <?php if($image = $project->images()->sortBy('sort', 'asc')->first()): $thumb = $image ?>
        <a href="<?php echo $project->url() ?>"><img src="<?= $thumb->url() ?>" alt="Thumbnail for <?= $project->title()->html() ?>" class="teaser-image" /></a>
              <?php endif ?>
       
        <span><?php echo $project->text()->excerpt(240) ?> </span> 
        <br><a class="cta" href="<?php echo $project->url() ?>">Jetzt lesen →</a>
      </li>
      <?php endforeach ?>
    </ul>

This error:
Error thrown with message "Call to a member function paginate() on null"
for this code:
<?php snippet('projects') ?>

The Visible etc. methods have been removed, you have to replace it with listed etc. instead.

Thank you very much. It works now. :slight_smile: