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

Freshly registered user doesn't have Config associated #2312

Closed
romu70 opened this issue Sep 27, 2016 · 39 comments
Closed

Freshly registered user doesn't have Config associated #2312

romu70 opened this issue Sep 27, 2016 · 39 comments
Assignees
Labels
Milestone

Comments

@romu70
Copy link

romu70 commented Sep 27, 2016

Issue details

Just playing with the Docker image from the hub, and it's way better than some months ago, great job! Within few minutes I was able to get a working Wallabag!!

But (damned "but"), when I want to create a user account, Wallabag tries to send an email and because I didn't do in this area on my computer, it can't. And so, I'm stucked with a unusable user account.

Any way to workaround or to fix this?

Environment

  • wallabag version (or git revision) that exhibits the issue: last Docker image as time of writing 2016-09-27
  • How did you install wallabag? Docker image
  • Last wallabag version that did not exhibit the issue (if applicable): N/A
  • php version: from Docker image
  • OS: from Docker image
  • type of hosting (shared or dedicated): own PC
  • which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL): MariaDB Docker container

Steps to reproduce/test case

  1. Install the need whole stack (MariaDB container + Wallabag container)
  2. Try to register a new user account.
@romu70 romu70 changed the title Docker image: no way to acivate the user? Docker image: no way to activate a new user account? Sep 27, 2016
@j0k3r
Copy link
Member

j0k3r commented Sep 27, 2016

You can switch the confirmation by email to false in the parameters.yml file:

https://github.com/wallabag/wallabag/blob/master/app/config/parameters.yml.dist#L37

Once this is done, run php bin/console clear:cache -e=prod (to rebuild the cache) and it should be ok.

@romu70
Copy link
Author

romu70 commented Sep 28, 2016

Thanks, but how can I do this? I guess this is related to the way the Wallabag Docker is built.

@j0k3r
Copy link
Member

j0k3r commented Sep 28, 2016

Hum yep, you can login into the docker image and do the change.

Locate the container using docker ps and then log into it using docker exec -i -t DOCKER_IMAGE_ID /bin/bash by replacing the DOCKER_IMAGE_ID with the one found in the docker ps (sth like ce24028bc122)

@romu70
Copy link
Author

romu70 commented Sep 28, 2016

That's what I've tried many times, doesn't work.

[romu@xps]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7c970f7732a0 wallabag/wallabag "/entrypoint.sh walla" 44 seconds ago Up 43 seconds 0.0.0.0:4000->80/tcp wallabag
8942b212c093 phpmyadmin/phpmyadmin "/run.sh phpmyadmin" 4 hours ago Up 4 hours 0.0.0.0:8080->80/tcp phpmyadmin
16b533774951 mariadb:latest "docker-entrypoint.sh" 4 hours ago Up 4 hours 3306/tcp mariadb

[romu@xps]$ docker exec -i -t 7c970f7732a0 /bin/bash
rpc error: code = 2 desc = oci runtime error: exec failed: exec: "/bin/bash": stat /bin/bash: no such file or directory

Any idea?

@j0k3r
Copy link
Member

j0k3r commented Sep 28, 2016

Ow :(
@xsteadfastx bash isn't available in the docker image?

@romu70
Copy link
Author

romu70 commented Sep 28, 2016

If we get a step higher from this issue, I think it depends what's the purpose of the Docker image. If we assume its purpose is to ease self-hosting, then, I guess this activation mechanism through email should be disabled by default.

I'm far from being a Docker expert, but if I clone this repository, can I generate a Dockerfile by myself?

@xsteadfastx
Copy link

@romu70 try docker exec -i -t 7c970f7732a0 /bin/sh. bash is not installed because of the image size.

@romu70
Copy link
Author

romu70 commented Sep 28, 2016

Thanks @xsteadfastx , I was able to change the settings, but when I run /var/www/wallabag # php bin/console clear:cache -e=prod, I get:

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "clear" namespace.

And Wallabag still tries to send an email to activate the account.

@j0k3r
Copy link
Member

j0k3r commented Sep 28, 2016

My bad. Try this instead:

php bin/console cache:clear -e=prod

@xsteadfastx
Copy link

that with email in the docker image... honestly i never used that with my little wallabag setup. i wonder how difficult it is... or what the requirements are to get that working. something like a ssmtp?

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

@xsteadfastx sendmail should be ok

@xsteadfastx
Copy link

@j0k3r isnt sendmail a little overload? im just asking. ssmtp is just a little tool to send mails to a relay email server.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

should be ok too :)

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Done the trick with the @j0k3r command, output:

/var/www/wallabag # php bin/console cache:clear -e=prod

// Clearing the cache for the prod environment with debug false

[OK] Cache for the "prod" environment (debug=false) was successfully cleared.

But now, when I open a new wallabag page, I get an empty page. Favicon is good, but nothing on the page, even when showing the source code of the page. Any idea?

I tried to restart the container with docker restart wallabag, and still tries to activate the account through email. Here is the /var/www/wallabag/app/config/parameters.yml.dist file:

/ # cat /var/www/wallabag/app/config/parameters.yml.dist

This file is a "template" of what your parameters.yml file should look like parameters:

# Uncomment these settings or manually update your parameters.yml
# to use docker-compose
#
# database_driver: %env.database_driver%
# database_host: %env.database_host%
# database_port: %env.database_port%
# database_name: %env.database_name%
# database_user: %env.database_user%
# database_password: %env.database_password%

database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_

mailer_transport:  smtp
mailer_host:       127.0.0.1
mailer_user:       ~
mailer_password:   ~

locale:            en

# A secret key that's used to generate certain security-related tokens
secret:            ovmpmAWXRCabNlMgzlzFXDYmCFfzGv

# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org

# fosuser stuff
fosuser_confirmation: false 

from_email: no-reply@wallabag.org`

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Could you look into /var/www/wallabag/var/logs/* files?

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Yep. Here is what I did:

  1. rm the /var/www/wallabag/var/logs/prod.log (only existing file)
  2. stop the container
  3. start the container
  4. Get the homepage (it worked)
  5. Register a new user (and it still tries to activate through email)

Here is the log file:

[2016-09-29 14:17:24] request.INFO: Matched route "{route}". {"route":"fos_user_registration_register","route_parameters":{"_controller":"FOS\UserBundle\Controller\RegistrationController::registerAction","_route":"fos_user_registration_register"},"request_uri":"http://localhost:4000/register/","method":"POST"} []
[2016-09-29 14:17:24] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2016-09-29 14:17:24] app.ERROR: Exception occurred while flushing email queue: Connection could not be established with host 127.0.0.1 [Connection refused #111] [] []

This helps?

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

So :)

  • don't stop the container
  • edit app/config/parameters.yml (not the .dist one)
  • set fosuser_confirmation: false
  • run php bin/console cache:clear -e=prod
  • check the homepage

I think the problem is that you edited parameters.yml.dist instead of parameters.yml

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

You win :-D but... clearing the cache still brings an empty page after a refresh. So, I still had to restart the container. Now it works, but I captured the log before the restart:

[2016-09-29 14:25:19] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable." at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92 {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:19] request.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92) {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:21] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable." at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92 {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:21] request.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92) {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:22] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable." at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92 {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:22] request.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92) {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:25] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable." at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92 {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:25] request.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92) {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:26] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable." at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92 {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []
[2016-09-29 14:25:26] request.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php line 92) {"exception":"[object](InvalidArgumentException%28code: 0%29: The directory "/var/www/wallabag/var/cache/prod/annotations" is not writable. at /var/www/wallabag/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:92)"} []

Hope this helps.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Ok permissions problem. It's because you cleared the cache using the root user and the www user now can't write to the cache directory which is now owned by root.

You don't need to restart the container everytime you got a blank page :)

For that could you chmod -R 777 var/cache

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Ok. I'm closing the issue. I now need to seriously think about my own setup.

Un grand merci à toi !!

@romu70 romu70 closed this as completed Sep 29, 2016
@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

haha 🍻

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Oups, I get an Error 500 when I click on "Archive": http://localhost:4000/archive/list (standard port redirected to 4000 for my testings).

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Could you share the content of /var/www/wallabag/var/logs/prod.log?

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Here it is:

[2016-09-29 14:35:39] request.INFO: Matched route "{route}". {"route":"archive","route_parameters":{"page":"1","_controller":"Wallabag\CoreBundle\Controller\EntryController::showArchiveAction","_route":"archive"},"request_uri":"http://localhost:4000/archive/list","method":"GET"} []
[2016-09-29 14:35:39] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area"} []
[2016-09-29 14:35:39] security.DEBUG: User was reloaded from a user provider. {"username":"romu","provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider"} []
[2016-09-29 14:35:39] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getItemsPerPage() on null" at /var/www/wallabag/src/Wallabag/CoreBundle/Controller/EntryController.php line 262 {"exception":"[object](Symfony\Component\Debug\Exception\FatalThrowableError%28code: 0%29: Call to a member function getItemsPerPage%28%29 on null at /var/www/wallabag/src/Wallabag/CoreBundle/Controller/EntryController.php:262)"} []
[2016-09-29 14:35:39] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []
[2016-09-29 14:36:01] request.INFO: Matched route "{route}". {"route":"archive","route_parameters":{"page":"1","_controller":"Wallabag\CoreBundle\Controller\EntryController::showArchiveAction","_route":"archive"},"request_uri":"http://localhost:4000/archive/list","method":"GET"} []
[2016-09-29 14:36:01] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area"} []
[2016-09-29 14:36:01] security.DEBUG: User was reloaded from a user provider. {"username":"romu","provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider"} []
[2016-09-29 14:36:01] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getItemsPerPage() on null" at /var/www/wallabag/src/Wallabag/CoreBundle/Controller/EntryController.php line 262 {"exception":"[object](Symfony\Component\Debug\Exception\FatalThrowableError%28code: 0%29: Call to a member function getItemsPerPage%28%29 on null at /var/www/wallabag/src/Wallabag/CoreBundle/Controller/EntryController.php:262)"} []
[2016-09-29 14:36:01] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

"starred", "Archive" and "All entries", all lead to the error 500.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Did you get that error with a recently created user with the email confirmation set to false?

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Yep.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

All right, there might be a bug.
Could you try again by creating a new user, save an article and archive it? If you got the same error share the log again.

@j0k3r j0k3r reopened this Sep 29, 2016
@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Created a new account, tried to add a new article -> 500.

[2016-09-29 14:57:07] request.INFO: Matched route "{route}". {"route":"new_entry","route_parameters":{"_controller":"Wallabag\CoreBundle\Controller\EntryController::addEntryFormAction","_route":"new_entry"},"request_uri":"http://localhost:4000/new-entry","method":"POST"} []
[2016-09-29 14:57:07] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area"} []
[2016-09-29 14:57:07] security.DEBUG: User was reloaded from a user provider. {"username":"rt","provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider"} []
[2016-09-29 14:57:08] graby.DEBUG: Graby is ready to fetch [] []
[2016-09-29 14:57:08] graby.DEBUG: Fetching url: {url} {"url":"http://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/"} []
[2016-09-29 14:57:08] graby.DEBUG: Trying using method "{method}" on url "{url}" {"method":"get","url":"http://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/"} []
[2016-09-29 14:57:08] graby.DEBUG: Data fetched: {data} {"data":{"effective_url":"http://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/","body":"(only length for debug): 110743","headers":"text/html","status":200}} []
[2016-09-29 14:57:08] graby.DEBUG: Opengraph data: {ogData} {"ogData":{"og_locale":"en_US","og_type":"article","og_title":"How to Shrink a Hyper-V Virtual Disk (VHD/VHDX)","og_description":"Shrinking a virtual may be somewhat tricky! Eric shows us how to make a Hyper-V virtual disk (VHD/VHDX) smaller in this post.","og_url":"http://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/","og_site_name":"Hyper-V Hub - Altaro's Microsoft Hyper-V blog","og_updated_time":"2016-05-17T14:14:20+02:00","og_image":"http://www.altaro.com/hyper-v/wp-content/uploads/2015/11/How-to-Shrink-a-Hyper-V-Virtual-Disk.png","og_image_width":"200","og_image_height":"200"}} []
[2016-09-29 14:57:08] graby.DEBUG: Looking for site config files to see if single page link exists [] []
[2016-09-29 14:57:08] graby.DEBUG: Attempting to extract content [] []
[2016-09-29 14:57:08] graby.DEBUG: . looking for site config for {host} in primary folder {"host":"altaro.com"} []
[2016-09-29 14:57:08] graby.DEBUG: Appending site config settings from global.txt [] []
[2016-09-29 14:57:08] graby.DEBUG: . looking for site config for {host} in primary folder {"host":"global"} []
[2016-09-29 14:57:08] graby.DEBUG: ... found site config {host} {"host":"global.txt"} []
[2016-09-29 14:57:08] graby.DEBUG: Cached site config with key: {key} {"key":"altaro.com"} []
[2016-09-29 14:57:08] graby.DEBUG: . looking for site config for {host} in primary folder {"host":"global"} []
[2016-09-29 14:57:08] graby.DEBUG: ... found site config {host} {"host":"global.txt"} []
[2016-09-29 14:57:08] graby.DEBUG: Appending site config settings from global.txt [] []
[2016-09-29 14:57:08] graby.DEBUG: Cached site config with key: {key} {"key":"global"} []
[2016-09-29 14:57:08] graby.DEBUG: Cached site config with key: {key} {"key":"altaro.com.merged"} []
[2016-09-29 14:57:08] graby.DEBUG: Attempting to parse HTML with {parser} {"parser":"libxml"} []
[2016-09-29 14:57:08] graby.DEBUG: Trying {pattern} for title {"pattern":"//meta[@Property="og:title"]/@content"} []
[2016-09-29 14:57:08] graby.DEBUG: Title matched: {title} {"title":"How to Shrink a Hyper-V Virtual Disk (VHD/VHDX)"} []
[2016-09-29 14:57:08] graby.DEBUG: ...XPath match: {pattern} ["pattern","//meta[@Property="og:title"]/@content"] []
[2016-09-29 14:57:08] graby.DEBUG: Trying {pattern} for language {"pattern":"//html[@lang]/@lang"} []
[2016-09-29 14:57:08] graby.DEBUG: Language matched: {language} {"language":"en-US"} []
[2016-09-29 14:57:08] graby.DEBUG: Stripping {length} elements with inline display:none or visibility:hidden style {"length":3} []
[2016-09-29 14:57:08] graby.DEBUG: hNews: found hentry [] []
[2016-09-29 14:57:08] graby.DEBUG: hNews: found "1" with .//*[contains(concat(' ',normalize-space(@Class),' '),' entry-content ')] [] []
[2016-09-29 14:57:08] graby.DEBUG: Pruning content [] []
[2016-09-29 14:57:08] graby.DEBUG: Success ? {is_success} {"is_success":true} []
[2016-09-29 14:57:08] graby.DEBUG: Returning data (most interesting ones): {data} {"data":{"title":"How to Shrink a Hyper-V Virtual Disk (VHD/VHDX)","language":"en-US","url":"http://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/","content_type":"text/html"}} []
[2016-09-29 14:57:08] graby.DEBUG: Filtering HTML to remove XSS [] []
[2016-09-29 14:57:08] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getTaggingRules() on null" at /var/www/wallabag/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php line 103 {"exception":"[object](Symfony\Component\Debug\Exception\FatalThrowableError%28code: 0%29: Call to a member function getTaggingRules%28%29 on null at /var/www/wallabag/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php:103)"} []
[2016-09-29 14:57:08] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Weird.
Looks like the config for the freshly created user isn't created.

What database are you using?
Could you try to run a query on it? (if you prefixed table without something else than wallabag_ please update the query)

SELECT * FROM wallabag_config

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

MariaDB from the official Docker image. My setup is made of 3 containers:

  • MariaDB latest
  • PhpMyAdmin latest
  • Wallabag latest

I run the Wallabag image with this command line:

docker run --name wallabag --link mariadb:wallabag-db -e "MYSQL_ROOT_PASSWORD=xxx" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=mariadb" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=yyy" -d -p 4000:80 wallabag/wallabag

As far as I see the database is correctly populated.

I do confirm the wallabag_config table only contains data for the default user. For the previous testing we discussed some moments ago, I created 2 user accounts and there is no line in this table for them.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

S**t.
I'll look into it.
Thanks !

@j0k3r j0k3r added the Bug label Sep 29, 2016
@j0k3r j0k3r changed the title Docker image: no way to activate a new user account? Freshly created user (from the config page) doesn't have Config associated Sep 29, 2016
@j0k3r j0k3r self-assigned this Sep 29, 2016
@romu70
Copy link
Author

romu70 commented Sep 29, 2016

I do confirm that if I duplicate the default line and change the ID and user_id fields values, no more error 500.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Just tried on my side using Docker too and the config is well created.

Before creating the user.

MariaDB [wallabag]> select * from wallabag_config;
+----+---------+----------+----------------+----------+-----------+-----------+---------------+
| id | user_id | theme    | items_per_page | language | rss_token | rss_limit | reading_speed |
+----+---------+----------+----------------+----------+-----------+-----------+---------------+
|  1 |       1 | material |             12 | en       | NULL      |        50 |             1 |
+----+---------+----------+----------------+----------+-----------+-----------+---------------+
1 row in set (0.00 sec)

And right after

MariaDB [wallabag]> select * from wallabag_config;
+----+---------+----------+----------------+----------+-----------+-----------+---------------+
| id | user_id | theme    | items_per_page | language | rss_token | rss_limit | reading_speed |
+----+---------+----------+----------------+----------+-----------+-----------+---------------+
|  1 |       1 | material |             12 | en       | NULL      |        50 |             1 |
|  2 |       2 | material |             12 | en       | NULL      |        50 |             1 |
+----+---------+----------+----------------+----------+-----------+-----------+---------------+
2 rows in set (0.00 sec)

MariaDB [wallabag]>

Let's remote debugging 😑
Could you edit the file src/Wallabag/CoreBundle/Controller/ConfigController.php and add that after line 148 ($em->flush();):

var_dump($config->getId(), $config->getUser()->getId());
die();

And paste here the results.
Also, after that, check what you have in the wallabag_config table.

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Just tried on my own PC (this afternoon this was on my Pro one), same containers setup, same issue. Nothing in the config table.

Definitely miss something here:

  • After tweaking the code, should I restart something or just save and close vi?
  • Where the dump is supposed to be output?

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Oups sorry forget to tell how to see the dump.
You should get the dumped elements right after creating a new user (this is the place where the config should be attached to the user)

@romu70
Copy link
Author

romu70 commented Sep 29, 2016

Right after? Where? On the screen? In a file? In the DB? Sorry I'm a web dev dummy.

@j0k3r
Copy link
Member

j0k3r commented Sep 29, 2016

Could you join on Gitter? https://gitter.im/wallabag/wallabag :)

@tcitworld
Copy link
Member

@j0k3r When I was trying to import accounts into framabag, the config wasn't created either while creating them from CLI so I couldn't import any articles into these accounts. See https://github.com/wallabag/wallabag/compare/framabag-v2 for what I had to do.

@j0k3r j0k3r changed the title Freshly created user (from the config page) doesn't have Config associated Freshly registered user doesn't have Config associated Sep 30, 2016
@j0k3r
Copy link
Member

j0k3r commented Sep 30, 2016

It'll be fixed in 2.1.0.
Thanks for reporting @romu70 !

@j0k3r j0k3r added this to the 2.1.0 milestone Sep 30, 2016
@j0k3r j0k3r closed this as completed Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants