Polls: Polls with expire date could not be created/edited

Created on 23 Dec 2018  路  19Comments  路  Source: nextcloud/polls

What is going wrong?

Describe the bug
Polls created with an expire date are not created/could not be edited.

To Reproduce
use an poll with an expire date

Expected behavior
polls should be created/edited regardless if the utilize n expire date or not

Information about your polls installation

Polls version? 0.9.5 / Fresh installation

How did you install this version?(Appstore or describe installation)
Appstore

Information about your Instance of Nextcloud/ownCloud

Nextcloud or ownCloud?
NC

Which Version?
15.0.0

Server configuration

Operating system: Ubuntu 16.04.5

Web server: Apache 2

Database: MySQL 5.5.27

PHP version: 7.2

Signing status: Ok

3. to review bug

Most helpful comment

OK. I got behind this. Seems like MariaDB is more strict, than MySQL. MySQL stores the datetime information more tolerant. Nvertheless, the datetime format misses the correct timezone information. I think, it is better to use string or timestamp as field type.

To dos:

  • [ ] Migrate field expire from datetime to timestamp (Current value is stored in UTC)
  • [ ] convert poll.event.expirationDate to timezone before saving to DB on the vue side
  • [ ] convert expiration date from timestamp to date object on loading polls

All 19 comments

I cannot reproduce this. Creating a pol lwith an expiry date is editable and I can place votes. Please submit more information and may be a log file entry and/or screen shots.

thx for fast reply - I'll provide info in the next few days - now @ PoC buildup for 35c3

@nextgen-networks you can provide your info at 35c3. I'll be there and (hopefully) working on polls 馃槈

@v1r0x :-D
Great to see you in person at 35c3 - just give me a hint where you're located at when you've arrived or call dect 2069

@nextgen-networks I'm either in heaven or walking around doing angel stuff or in talks. Unfortunately, I don't have a DECT :(

I can confirm that the expire option does not work.

When using an expire date the update/create button just spinns forever and never finishes.

I am using https://hub.docker.com/_/nextcloud with the newest version

I cannot confirm. Works here as designed on several instances. Some more information would help.
Configuration, screen shots, ...

poll

"Writing Poll" will keep appearing indefinitely.

When I do not ckeck the expire box everything works fine

The server runs a default config with mariadb

Hi,

i have the same problem. When i check the expiration field, the poll could not be created. The status wheel rotates endlessly and nothing happens.
Server: Ubuntu 16.04
Nextcloud:Version: 14.0.4.2
PHP Version: 7.0.32
DB: mysql

grafik

Anyone with some hints?
Server errors, console log errors?

I have the same issue. Works fine if no expiration is given.

A nice addition would be to have a warning on the web page that "something went wrong". The only thing I have is the working button. No info is given that it didn't work.

Would like to help more, but SQL and JS are not my strong suits. The mariadb setup says that the expire field is of datetime format and doc doesn't says it support the timezone in it: https://mariadb.com/kb/en/library/datetime/

so 2019-01-13T21:00:00.000Z doesn't look valid.

I hope it helps

[index] Error: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO oc_polls_events(title,description,type,is_anonymous,full_anonymous,allow_maybe,access,expire,owner,created,hash) VALUES(?,?,?,?,?,?,?,?,?,?,?)' with params ["test titre", "test descrip", 0, 0, 0, 0, "public", "2019-01-13T21:00:00.000Z", "fnadeau", "2019-01-12 21:15:45", "L67SGXXn1vH8araA"]:

SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2019-01-13T21:00:00.000Z' for column 'expire' at row 1 at <>

  1. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 128
    convertException("An exception oc ... 1", Doctrine\DBAL\Dr ... ]})
  2. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php line 177
    driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "INSERT INTO `oc ... )", {1: "test titre" ... "})
  3. /var/www/html/lib/public/AppFramework/Db/Mapper.php line 256
    execute()
  4. /var/www/html/lib/public/AppFramework/Db/Mapper.php line 130
    execute("INSERT INTO `*P ... )", ["test titre","t ... "])
  5. /var/www/html/custom_apps/polls/lib/Controller/ApiController.php line 383
    insert(OCA\Polls\Db\Event {id: null})
  6. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 166
    writePoll({id: 0,hash: "", ... "}, {pollDates: [{id ... ]}, [], "create")
  7. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 99
    executeController(OCA\Polls\Contro ... }}, "writePoll")
  8. /var/www/html/lib/private/AppFramework/App.php line 118
    dispatch(OCA\Polls\Contro ... }}, "writePoll")
  9. /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    main("OCA\Polls\Controller\ApiController", "writePoll", OC\AppFramework\ ... {}, {_route: "polls.api.write_poll"})
  10. <>
    __invoke({_route: "polls.api.write_poll"})

    1. /var/www/html/lib/private/Route/Router.php line 297

      call_user_func(OC\AppFramework\ ... {}, {_route: "polls.api.write_poll"})

    2. /var/www/html/lib/base.php line 987

      match("/apps/polls/write")

    3. /var/www/html/index.php line 42

      handleRequest()

POST /apps/polls/write
from 172.18.0.3 by fnadeau at 2019-01-12T21:15:45+00:00

so 2019-01-13T21:00:00.000Z doesn't look valid.

True. This is not valid. But on my site, the date is formattet correctly. The time converting maybe buggy and is horrible, because of the time zones. I will follow the path from crating to persisting, but not in the next two weeks.

Thanks @fnadeau This information helps.

What is your locale setting?

Ah: Note to myself, check error handling...

OK. I got behind this. Seems like MariaDB is more strict, than MySQL. MySQL stores the datetime information more tolerant. Nvertheless, the datetime format misses the correct timezone information. I think, it is better to use string or timestamp as field type.

To dos:

  • [ ] Migrate field expire from datetime to timestamp (Current value is stored in UTC)
  • [ ] convert poll.event.expirationDate to timezone before saving to DB on the vue side
  • [ ] convert expiration date from timestamp to date object on loading polls

What is your locale setting?

French Canadian, if that matters...

Please be patient. I am 15.000 km from home. Will investigate and fix this, when I am back.

@nextgen-networks Are you able to test the branch from the #514 PR?

@fnadeau, @gmk1981, @jio3252 Maybe you can confirm or deny the fix, too. I don't have the problem on my instances and I am limited in configure the DB server.
My MySQL accepts the time format like '2019-01-13T21:00:00.000Z'.

Merged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wiertz picture wiertz  路  5Comments

andriusign picture andriusign  路  6Comments

Jana702 picture Jana702  路  4Comments

BurtGummer picture BurtGummer  路  3Comments

Dubidubiduu picture Dubidubiduu  路  5Comments