Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error when enabling Memories app #14

Closed
meichthys opened this issue Aug 22, 2022 · 21 comments
Closed

Syntax Error when enabling Memories app #14

meichthys opened this issue Aug 22, 2022 · 21 comments

Comments

@meichthys
Copy link
Contributor

I've followed the installation instructions, but when trying to run the index occ command, I'm getting a syntax error:

sudo -u www-data php /var/www/nextcloud/occ apps:memories
An unhandled exception has been thrown:
ParseError: syntax error, unexpected ')', expecting '|' or variable (T_VARIABLE) in /var/www/nextcloud/apps/memories/lib/Db/TimelineWrite.php:58
Stack trace:
#0 /var/www/nextcloud/lib/composer/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 /var/www/nextcloud/apps/memories/lib/Command/Index.php(79): spl_autoload_call()
#3 [internal function]: OCA\Memories\Command\Index->__construct()
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): ReflectionClass->newInstanceArgs()
#5 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(116): OC\AppFramework\Utility\SimpleContainer->buildClass()
#6 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(133): OC\AppFramework\Utility\SimpleContainer->resolve()
#7 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(465): OC\AppFramework\Utility\SimpleContainer->query()
#8 /var/www/nextcloud/lib/private/ServerContainer.php(145): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#9 /var/www/nextcloud/lib/private/Console/Application.php(217): OC\ServerContainer->query()
#10 /var/www/nextcloud/lib/private/Console/Application.php(128): OC\Console\Application->loadCommandsFromInfoXml()
#11 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#12 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#13 {main}user@hostname:/var/www/nextcloud/apps#

This syntax error throws an internal server error in nextcloud which prevents all nextcloud access:
image

@pulsejet
Copy link
Owner

Which php version are you running?

pulsejet added a commit that referenced this issue Aug 22, 2022
@pulsejet
Copy link
Owner

Try now

@meichthys
Copy link
Contributor Author

Which php version are you running?

PHP 7.4.3
Trying now...

@pulsejet
Copy link
Owner

I just rebuilt the js, so you might need to clear cache (#10)

@meichthys
Copy link
Contributor Author

It's indexing now 👍
I do still have the internal server error even after clearing the cache, but only for memories now. I'm assuming that it will take care of itself after the indexing is finished?

@pulsejet
Copy link
Owner

pulsejet commented Aug 22, 2022

Huh you've two errors? What does the internal server error say? Definitely not related to the indexing.

@meichthys
Copy link
Contributor Author

image

The Memories app seems to be the only app that is affected.

@pulsejet
Copy link
Owner

That isn't an error log ... I need the stuff below this (in debug mode)

@meichthys
Copy link
Contributor Author

I'm not sure how to enable debug mode, but i do see this in nextcloud.log:

"app":"index","method":"GET","url":"/apps/memories/","message":"syntax error, unexpected ')', expecting variable (T_VARIABLE)"

@pulsejet
Copy link
Owner

Just set debug => true in config.php. Need more details than this.

@meichthys
Copy link
Contributor Author

Looks like the indexing failed half way:
image

I'll set debug mode and see what else i can find.

@meichthys
Copy link
Contributor Author

Here's the debug log information:

    Request ID: o4Vx6n5gBK0LzM5JHREh
    Type: ParseError
    Code: 0
    Message: syntax error, unexpected ')', expecting variable (T_VARIABLE)
    File: /var/www/nextcloud/apps/memories/lib/Controller/PageController.php
    Line: 31


Trace

#0 /var/www/nextcloud/lib/composer/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 [internal function]: spl_autoload_call()
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(114): ReflectionClass->__construct()
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(133): OC\AppFramework\Utility\SimpleContainer->resolve()
#5 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(465): OC\AppFramework\Utility\SimpleContainer->query()
#6 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(437): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#7 /var/www/nextcloud/lib/private/AppFramework/App.php(159): OC\AppFramework\DependencyInjection\DIContainer->query()
#8 /var/www/nextcloud/lib/private/Route/Router.php(298): OC\AppFramework\App::main()
#9 /var/www/nextcloud/lib/base.php(1023): OC\Route\Router->match()
#10 /var/www/nextcloud/index.php(36): OC::handleRequest()
#11 {main}

@pulsejet
Copy link
Owner

You gotta be kidding... give me a few minutes

pulsejet added a commit that referenced this issue Aug 22, 2022
@pulsejet
Copy link
Owner

Okay, hopefully fixed now. Try indexing again; it should resume (quickly catch up to) from where it stopped.

@meichthys
Copy link
Contributor Author

Looking good now!
I am getting alot of the following logs, but photos are displaying in the app now.

Failed to create memories record: An exception occurred while executing a query: SQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint "memories_day_uf_ui"
DETAIL:  Key (uid, fileid)=(username, 235521) already exists.

@pulsejet
Copy link
Owner

That is super strange. What db/version is this?

@meichthys
Copy link
Contributor Author

meichthys commented Aug 22, 2022

Nextcloud 24.0.3
Database: PostgreSQL 12.12
(I'm running the Nextcloud VM)

@pulsejet
Copy link
Owner

I can't repro with the same versions of everything. Maybe I need to run the VM itself, but it's still strange.
Open a new issue for this if it persists.

@meichthys
Copy link
Contributor Author

The issue still persists but it seems like all of the photos were indexed and show up fine in the app. I won't worry about it right now.

@pulsejet
Copy link
Owner

It will be a problem only if you edit the exif data on any of the photos.

@meichthys
Copy link
Contributor Author

Good to know. Thanks.

pulsejet added a commit that referenced this issue Nov 1, 2023
get dockerfile working on windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants