anchor-cms icon indicating copy to clipboard operation
anchor-cms copied to clipboard

Anchor Failing to display main site upon completion of installation

Open agottschling opened this issue 7 years ago • 10 comments

Summary

As soon as I finish the installation, and click on the button to either visit the admin panel, or the site, it crashes with the following error:

Something went wrong, please notify the owner of the site

Call to undefined method Error::log()
The error has been logged in /anchor/errors.log
Uncaught Exception

Call to undefined method Error::log()

Origin

anchor/run.php on line 50

Trace

#0 /var/www/html/blog.andrewgottschling.me/system/start.php(26): require()
#1 /var/www/html/blog.andrewgottschling.me/index.php(35): require('/var/www/html/b...')
#2 {main}

Expected Behaviour

  • The site or admin panel should display

Actual Behaviour

  • The page crashes and displays a stack trace

Context details (if applicable)

  • Anchor version:0.12.1
  • Server setup:Ubuntu 16.04.2, latest apache, php7
  • URL: http://blog.andrewgottschling.me

EDIT:

This seems to be the same error as #1111 and #1163, but I didn't want to coremod the installation, and php-pear is up to date according to apt

agottschling avatar Mar 04 '17 04:03 agottschling

Any updates? @daviddarnes

agottschling avatar Mar 26 '17 01:03 agottschling

@agottschling afraid not from me, this may me more @CraigChilds94 or @TheBrenny's area?

daviddarnes avatar Mar 26 '17 15:03 daviddarnes

I am facing the same issue but only on one hosting. The other one is fine.

adinafxv avatar Apr 23 '17 18:04 adinafxv

@adinafxv interesting, do they have different php versions?

daviddarnes avatar Apr 23 '17 21:04 daviddarnes

@daviddarnes they are both PHP 7. I've contacted provider of hosting that gives me this error, so hopefully I'll get some help or at least info what's the problem there. I will definitely share.

adinafxv avatar Apr 23 '17 21:04 adinafxv

@daviddarnes I am back with the info: The error was caused in database MySQL 5.7., when moved to MySQL 5.6 it works fine now. I asked about details of error in MySQL 5.7 and they said that there was "MySQL query while (there was) incorrect usage of NULL at column which was "date type". I dont understand, but maybe it can help.

adinafxv avatar Apr 24 '17 10:04 adinafxv

I am seeing the same error here - PHP7 with Mysql 5.7

Replaced Mysql with Maria 10.0.29 and all is good!

NoelBradford avatar Apr 29 '17 12:04 NoelBradford

I also confirm the bug with mysql

Database Error: SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value SQL: ALTER TABLE anchor_comments CHANGE date date datetime NOT NULL AFTER status The error has been logged in /anchor/errors.log

Uncaught Exception

Database Error: SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value

SQL: ALTER TABLE anchor_comments CHANGE date date datetime NOT NULL AFTER status

Origin

system/database/connector.php on line 52

Trace

#0 [internal function]: System\Database\Connector->ask('ALTER TABLE `an...') #1 /var/www/html/anchor-cms/system/database.php(77): call_user_func_array(Array, Array) #2 /var/www/html/anchor-cms/anchor/migrations/21_alter_comments_date.php(10): System\Database::__callStatic('ask', Array) #3 /var/www/html/anchor-cms/anchor/libraries/migrations.php(54): Migration_alter_comments_date->up() #4 /var/www/html/anchor-cms/anchor/libraries/anchor.php(105): Migrations->up(211) #5 /var/www/html/anchor-cms/anchor/libraries/anchor.php(25): Anchor::migrations() #6 /var/www/html/anchor-cms/anchor/run.php(42): Anchor::setup() #7 /var/www/html/anchor-cms/system/start.php(26): require('/var/www/html/a...') #8 /var/www/html/anchor-cms/index.php(35): require('/var/www/html/a...') #9 {main}

In the database anchor_comments is completely empty, for example pages is ok, comments is empty

mysql> select * from anchor_pages; +----+-------+-------+-----------------------+----------+-----------+----------+--------------+------------+ | id | slug | name | title | content | status | redirect | show_in_menu | menu_order | +----+-------+-------+-----------------------+----------+-----------+----------+--------------+------------+ | 1 | posts | Posts | My posts and thoughts | Welcome! | published | | 1 | 0 | +----+-------+-------+-----------------------+----------+-----------+----------+--------------+------------+ 1 row in set (0.01 sec)

mysql> select * from anchor_comments; Empty set (0.00 sec)

zopar avatar May 22 '17 10:05 zopar

this is a duplicate of #1178

zopar avatar May 22 '17 12:05 zopar

I've got quite a bit to say, so brace yourselves...

First off, I'd like to take the time to say cheers for reporting the issues that you're having, and, from the team, apologies for not promptly fixing them. As you can appreciate, Anchor isn't a full-time job so we heavily rely on the community to contribute code where they can. But thank you, once again for pointing these issues out.

On a note of pointing issues out, there's more than one that's been identified on this thread, and likely already been reported (one stack trace is reporting a call to an undefined method, and the other is calling a bad SQL query). It would be best to add a comment onto the relevant issue in very much the same way that a new issue is created - with an emphasis on steps to reproduce, and server configuration (including anchor version and where you sourced it from).

@adinafxv & @zopar, cheers! That'll help us identify and resolve AN issue.

@agottschling, if you could try the latest commit to the master branch; just download the zip from GitHub, and tell me if it changes the issue.

Once again, apologies for the delay.

TheBrenny avatar Jun 15 '17 23:06 TheBrenny