muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.31k stars 324 forks source link

Docker image has a corrupted build #244

Closed dogik closed 5 years ago

dogik commented 5 years ago

I was going to run beehive in docker, but faced a blank page when accessing it from browser. I get the following errors in my browser console (tried IE, Vivaldi and chrome):

vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:13 Error while processing route: hives.all Unexpected token < in JSON at position 0 SyntaxError: Unexpected token < in JSON at position 0
    at parse (<anonymous>)
    at ee (http://hazard.vzadoo.com:8181/assets/vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:4:31980)
    at n (http://hazard.vzadoo.com:8181/assets/vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:6:31070)
    at XMLHttpRequest.<anonymous> (http://hazard.vzadoo.com:8181/assets/vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7:4282)
h @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:13
error @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:14
v @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:13
d @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:22
trigger @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:23
(anonymous) @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:22
....

vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:11 SyntaxError: Unexpected token < in JSON at position 0
    at parse (<anonymous>)
    at ee (vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:4)
    at n (vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:6)
    at XMLHttpRequest.<anonymous> (vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7)
s @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:11
o @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:11
n @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:14
trigger @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:23
(anonymous) @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:23
invoke @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
flush @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
flush @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
end @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
run @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
join @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
l.join @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:12
c.error @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:30
l @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:5
fireWith @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:5
n @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:6
(anonymous) @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7
load (async)
send @ vendor-b3fb1a9072b30aa6b2b5a5a6f72c2d21.js:7

Steps to reproduce:

  1. docker run --name beehive -d -p 8181:8181 dogik/beehive:latest
  2. open browser at http://url:8181- you will get a blank page
  3. Go to browser console - see the error above

I tried:

  1. building from dockerfile from scratch.
  2. Building from scratch using CANONICAL_URL variable (thoughе that I might get it because I am running on host other than localhost)
  3. Tried going back to 4bfd485 commit and building again (to see if the issue was introduced recently) - still get the same issue.

Can you please advise on what am I doing wrong? Thanks.

muesli commented 5 years ago

You will have to change the value of CANONICAL_URL indeed. Set it to http://url:8181.

dogik commented 5 years ago

@muesli thanks. Apologies, indeed docker run --name beehive -d -p 8181:8181 -e CANONICAL_URL=http://url:8181 fribbledom/beehive:latest fixed this issue. I probably messed up something while playing with builds.

muesli commented 5 years ago

Don't worry, glad to hear you managed to solve it. We clearly need to handle this situation better than silently failing with a (seemingly) blank page. As a first step I've added an extra Docker example to the README, but we'll really have to fix this in the admin interface.

gingerbeardman commented 2 years ago

Thanks for this.

I missed the docket at the bottom of the readme.

Does the docket higher up without the canonical url work in any circumstances?