Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Anchor Failing to display main site upon completion of installation #1190

Open
agottschling opened this issue Mar 4, 2017 · 10 comments
Open
Assignees

Comments

@agottschling
Copy link

agottschling commented Mar 4, 2017

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)

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
Copy link
Author

Any updates? @daviddarnes

@daviddarnes
Copy link
Member

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

@adinafxv
Copy link

adinafxv commented Apr 23, 2017

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

@daviddarnes
Copy link
Member

@adinafxv interesting, do they have different php versions?

@adinafxv
Copy link

@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
Copy link

@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.

@NoelBradford
Copy link

NoelBradford commented Apr 29, 2017

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

Replaced Mysql with Maria 10.0.29 and all is good!

@CraigChilds94 CraigChilds94 self-assigned this May 3, 2017
@zopar
Copy link

zopar commented May 22, 2017

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
Copy link

zopar commented May 22, 2017

this is a duplicate of #1178

@TheBrenny
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants