plainblack.com
Username Password
search
Bookmark and Share

    
Goto page «Previous Page   1 2    Next Page»

wG8 Docker image

User scottwalters
Date 9/2/2015 3:25 pm
Views 6123
Rating 1    Rate [
|
]
Previous · Next
User Message
martien

Hi Scott,



If you are already doing that (re-starting existing instances rather than generating new ones) and it's losing your data, give me a transcript of exactly what you're doing when this happens and I'll look in to it, but off the top of my head, I'm guessing that that's the most likely explanation.

The problem is not Docker but working on WebGUI after initialising as a first step:

- login -> edit (page, article,...)
- input some text
- save

- Nothing changed

--- (Edited on 2015-10-23 00:14 [GMT+0200] by martien) ---



Back to Top
Rate [
|
]
 
 
scottwalters

Oh, hmm.  I see.

I guess I didn't test very well.  I got past the setup wizard and decided things were pretty good.

This ierror appears in /data/webgui.log whenever I try to save anything:

2015/10/22 22:57:51 - ERROR - www_example_com.conf - WebGUI::Asset::dispatch[823] - Couldn't call method ``www_editSave'' on asset for url ``/home/welcome'':  Error: ``Can't call method "set" on an undefined value at /data/WebGUI/lib/WebGUI/VersionTag.pm line 170.

Creating a version tag doesn't actually create a version tag.

Adding content works on my local dev version, so I'm not sure what about Docker is breaking that.  I'm going to have to investigate.

Or if you want to poke around inside there and see if you can figure it out, this is how you get "inside" a Docker container:

docker run -i -t -p 80:80 scrottie/webgui8 /bin/bash

Then you'll have a shell prompt like "root@e2238b85de6a:/#".

Then I ran "/data/webgui.sh &" and hit it with the web browser while poking at log files.

Unit tests are failing in compile checks so I need to fix that before I can try to run the unit tests in there to see if that does the work for me of ferreting out what's busted.

Thanks for bringing that problem to my attention.

--- (Edited on 10/22/2015 6:12 pm [GMT-0500] by scottwalters) ---



Back to Top
Rate [
|
]
 
 
scottwalters

I eventually dug in and figured this out, a while ago, and did a quickie work-around.  The code in VersionTag.pm and other places need to handle errors better.  MySQL was erroring in critical code paths and that was completely hidden.  Errors were because a version of MySQL changed the default from ignoring constraints to enforcing them, and the constraints in create.sql really don't match what wG is doing.  Lots of fields with non-null constraints on them are routinely left null, for example.

Here's the commit with notes:

commit e51dfbccf30b580f0887b1eeb7a39a84739b2b2a
Author: Scott Walters <scott@slowass.net>
Date:   Tue Aug 9 01:38:37 2016 +0000

    mysql hasn't been enforcing "not null" constraints.
    
    as explained here:  http://stackoverflow.com/questions/7264702/i-set-a-mysql-column-to-not-null-but-still-i-can-insert-an-empty-value
    
    mysql has traditionally been in non-strict mode.  a whole pile of
    "not null" clauses are completely ignored by the code.  for example,
    VersionTag.pm in create() and new() will insert a 'new' record
    without a name or several other "not null" values, which would
    silently fail as $session->db->setRow() completely blackholes
    errors.
    
    so, remove all of the "not null" clauses that don't also specify
    a default.

Going through that commit to sort out which constraints make sense and which don't, and putting back the ones that do, will be a project.  I'm going to put that off.

For now, the Debian installer should be running again (and the automatic error feedback feature should be working again, more importantly), and I used that to build a new Docker image.

Uploading the docker image seems to have deleted previous discussion on DockerHub.  That was not intentional.

Anyway, that's at https://hub.docker.com/r/scrottie/webgui8/.  Please test and give feedback.

My plan right now is to fix up CentOS and maybe OSX installer support, then try to tackle the admin.

--- (Edited on 6/2/2017 7:01 pm [GMT-0500] by scottwalters) ---



Back to Top
Rate [
|
]
 
 
martien

Hi Scott,

I gave it a try with
"docker pull scrottie/webgui8"

and
"docker run -p 80:80 scrottie/webgui8:latest"

I didn't see a difference. It's still not possible to make changes.

--- (Edited on 2017-06-13 14:56 [GMT+0200] by martien) ---



Back to Top
Rate [
|
]
 
 
scottwalters

I didn't see a difference. It's still not possible to make changes.



Sorry for the long pause there.  Not being skilled at Docker, there was a dumb mistake in my workflow there.  You're right... that was exactly the same image.  Fixes didn't make it from git into the Docker image.  This is fixed now.

If you do "docker pull scrottie/webgui8:latest", you'll get this.

Then "docker run -p 81:80 -t scrottie/webgui8:latest" runs it.

You can add an optional "-i" to make that go in the foreground:

docker run -i -p 81:80 -t scrottie/webgui8:latest

-p maps a port on your machine (first number) to the port inside the container (which is 80).  So you could change 81 to 8080 if you wanted, for example.

If you wanted to mess around inside the image, you could tell it to run bash instead of the default of /data/webgui.sh:

docker run -i -p 81:80 -t scrottie/webgui8:latest bash

Again (trying to summerize stuff for any newcomers), most changes that happen inside the docker container are not preserved with the exceptions of these directories:   /var/lib/mysql, /data/domains/www.example.com/public/uploads.  (I'll add /data/WebGUI/etc to the list for next time.)  Those survive the container being stopped and started after it is run.  In Docker, you 'run' a container to make a new VM-lite thing, then can 'stop' and 'start' it or 'rm' it.  'docker ps -a' shows everything you've 'run' but not yet 'rm'ed.

Compared to just running the installer inside the "perl" docker image and nothing else, this image also rm's /root/.cpanm/work and changes /data/webgui.sh not to start plackup in the background (so that the Docker image doesn't immediately exit).  One nit is that wG comes up before MySQL does, so you'll see the "unable to connect to mysql" error for a minute before it starts working.  I should probably fix that (better to refuse connections than give errors when multiple images are in rotation).  I should also steal code from JT's admin to create more sites since most people probably don't own example.com.

Testing and feedback would be very appreciated.  I'd like to add a note to the experimental installer to consider using the Docker image instead, but the installer has been very handy for building the Docker images.

OSX support in the experimental installer is almost certainly broken again by now too.  Anyone available to help with that?  I may take another stab at CentOS but I keep running into issues that I could really benefit from some tech support on from someone familiar with newer versions of it.

--- (Edited on 11/8/2017 10:55 am [GMT-0600] by scottwalters) ---



Back to Top
Rate [
|
]
 
 
martien


Then "docker run -p 81:80 -t scrottie/webgui8:latest" runs it.

Hi Scott,

I gave it a try with the docker file and found that the mysql problem seems to be solved.

My next try was to init a Thingy.

Thingy was ok, but it was not possible to init a thing.

Is that (Thningy not working) the normal status or is it a docker issue?

Regards, Martien

--- (Edited on 2017-11-15 14:18 [GMT+0100] by martien) ---



Back to Top
Rate [
|
]
 
 
     Goto page «Previous Page   1 2    Next Page»



© 2017 Plain Black Corporation | All Rights Reserved