service-bot / servicebot

Open-source subscription management & billing automation system
https://servicebot.io
GNU General Public License v3.0
934 stars 244 forks source link

ServiceBot set-up makes request to non-existent URL #299

Closed sjlongland closed 6 years ago

sjlongland commented 6 years ago

When configuring ServiceBot in either Firefox 57 or Chromium 63, the set-up fails with the message "There seems to be a problem in processing your request. Please try again.". Trying again does nothing.

Deployed instance for trial of ServiceBot:

Deployment details:

Logs from console (Firefox):

Download the React DevTools for a better development experience: https://fb.me/react-devtools
bundle.js:99449:9
GETTIN PLUGIN! core-input-types
bundle.js:124812:37
THIS IS PLUGIN 
Object { run: run() }
bundle.js:124817:37
GETTIN PLUGIN! ga
bundle.js:124812:37
THIS IS PLUGIN 
Object { run: run(), … }
bundle.js:124817:37
 action  PLUGIN_ENABLED  @ 15:57:30.527
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "PLUGIN_ENABLED", plugin: {…}, … }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
Download the React DevTools for a better development experience: https://fb.me/react-devtools
core-input-types.js:16765:9
 action  PLUGIN_ENABLED  @ 15:57:30.572
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "PLUGIN_ENABLED", plugin: {…}, … }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
 action  SERVICE_PROVIDED  @ 15:57:30.575
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "SERVICE_PROVIDED", serviceType: "widget", service: {…}, provider: undefined, ephemeral: false, … }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
 action  SERVICE_PROVIDED  @ 15:57:30.576
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "SERVICE_PROVIDED", serviceType: "widget", service: {…}, provider: undefined, ephemeral: false, … }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
 action  SERVICE_PROVIDED  @ 15:57:30.576
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "SERVICE_PROVIDED", serviceType: "widget", service: {…}, provider: undefined, ephemeral: false, … }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
 action  SERVICE_PROVIDED  @ 15:57:30.577
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "SERVICE_PROVIDED", serviceType: "widget", service: {…}, provider: undefined, ephemeral: false, … }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
 action  @@router/LOCATION_CHANGE  @ 15:57:30.589
bundle.js:124727:5935
 prev state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6174
 action     
Object { type: "@@router/LOCATION_CHANGE", payload: {…} }
bundle.js:124727:6294
 next state 
Object { allForms: {}, options: {}, notifications: [], system_notifications: [], alerts: [], uid: null, permissions: [], user: {}, form: {}, routing: {…}, … }
bundle.js:124727:6544
React Hot Loader: this component is not accepted by Hot Loader. 
Please check is it extracted as a top level class, a function or a variable. 
Click below to reveal the source location: 

function Route()
bundle.js:94487:5
React Hot Loader: this component is not accepted by Hot Loader. 
Please check is it extracted as a top level class, a function or a variable. 
Click below to reveal the source location: 

function Router()
bundle.js:94487:5
React Hot Loader: this component is not accepted by Hot Loader. 
Please check is it extracted as a top level class, a function or a variable. 
Click below to reveal the source location: 

function RouterContext()
bundle.js:94487:5
Unhandled promise rejection 
Response { type: "basic", url: "https://widesky.vrtaws.vk4msl.id.au/api/v1/system-options/public", redirected: false, status: 404, ok: false, statusText: "Not Found", headers: Headers, bodyUsed: false }
bundle.js:110572:11
onUnhandled/</result<
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:110572:11
module.exports
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:67458:27
onUnhandled/<
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:110566:16
module.exports
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:110819:25
<anonymous>
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:67394:7
run
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:67380:5
listener
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:67384:3
React Hot Loader: this component is not accepted by Hot Loader. 
Please check is it extracted as a top level class, a function or a variable. 
Click below to reveal the source location: 

function Link()
bundle.js:94487:5
Warning: SetupStripe is changing an uncontrolled input of type undefined to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
bundle.js:33655:7
Proxy { <target>: {…}, <handler>: {…} }
bundle.js:186730:17
handleSubmit
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:186730:17
proxiedMethod
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:98272:16
boundFunc
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:55024:9
ReactErrorUtils.invokeGuardedCallback
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:55030:7
executeDispatch
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:54814:5
executeDispatchesInOrder
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:54837:5
executeDispatchesAndRelease
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:45258:5
executeDispatchesAndReleaseTopLevel
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:45269:10
forEachAccumulated
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:64696:5
processEventQueue
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:45469:7
runEventQueueInBatch
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:103668:3
handleTopLevel
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:103678:5
handleTopLevelImpl
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:106922:5
perform
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:49728:13
batchedUpdates
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:106841:14
batchedUpdates
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:38670:10
dispatchEvent
https://widesky.vrtaws.vk4msl.id.au/build/bundle.js:106997:7
unreachable code after return statement
[Learn More]
bundle.js:181460:28
Source map error: request failed with status 404
Resource URL: https://widesky.vrtaws.vk4msl.id.au/build/bundle.js
Source Map URL: es6-promise.map
[Learn More]
bsears90 commented 6 years ago

What does your deployment look like? I run a very similar setup with Kubernetes.

sjlongland commented 6 years ago

As I say, not very complicated; just a nginx front-end proxy pointed at ServiceBot (private image on Docker Hub; it generated the above nginx config). The container we use for the front-end proxy takes care of Let's Encrypt registration. The deployment script was generated from a tweaked (by adding the reverse proxy) docker-compose.yml file, then converted using kompose.

apiVersion: v1
items:
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      kompose.cmd: kompose convert -o kompose.yml -f docker-compose.yaml
      kompose.version: 1.8.0 (HEAD)
    creationTimestamp: null
    labels:
      io.kompose.service: db
    name: db
  spec:
    clusterIP: None
    ports:
    - name: headless
      port: 55555
      targetPort: 0
    selector:
      io.kompose.service: db
  status:
    loadBalancer: {}
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      kompose.cmd: kompose convert -o kompose.yml -f docker-compose.yaml
      kompose.version: 1.8.0 (HEAD)
    creationTimestamp: null
    labels:
      io.kompose.service: nginx
    name: nginx
  spec:
    ports:
    - name: "80"
      port: 80
      targetPort: 80
    - name: "443"
      port: 443
      targetPort: 443
    type: LoadBalancer
    selector:
      io.kompose.service: nginx
  status:
    loadBalancer: {}
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      kompose.cmd: kompose convert -o kompose.yml -f docker-compose.yaml
      kompose.version: 1.8.0 (HEAD)
    creationTimestamp: null
    labels:
      io.kompose.service: servicebot
    name: servicebot
  spec:
    clusterIP: None
    ports:
    - name: headless
      port: 55555
      targetPort: 0
    selector:
      io.kompose.service: servicebot
  status:
    loadBalancer: {}
- apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    annotations:
      kompose.cmd: kompose convert -o kompose.yml -f docker-compose.yaml
      kompose.version: 1.8.0 (HEAD)
    creationTimestamp: null
    labels:
      io.kompose.service: db
    name: db
  spec:
    replicas: 1
    strategy: {}
    template:
      metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: db
      spec:
        containers:
        - env:
          - name: POSTGRES_DB
            value: 'xxxxxxxx'
          - name: POSTGRES_PASSWORD
            value: 'xxxxxxxx'
          - name: POSTGRES_USER
            value: 'xxxxxxxx'
          image: postgres:latest
          name: db
          resources: {}
        restartPolicy: Always
        imagePullSecrets:
        - name: regcred
  status: {}
- apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    annotations:
      kompose.cmd: kompose convert -o kompose.yml -f docker-compose.yaml
      kompose.version: 1.8.0 (HEAD)
    creationTimestamp: null
    labels:
      io.kompose.service: nginx
    name: nginx
  spec:
    replicas: 1
    strategy:
      type: Recreate
    template:
      metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: nginx
      spec:
        containers:
        - env:
          - name: CERT_TYPE
            value: le
          - name: LETS_ENCRYPT_ADMIN
            value: softeng@vrt.com.au
          - name: MOUNT_DEST0
            value: /
          - name: MOUNT_SRC0
            value: http://servicebot:3000/
          - name: SECURE_REDIRECT
            value: "TRUE"
          - name: SERVER_NAME
            value: widesky.vrtaws.vk4msl.id.au
          image: vrtsystems/widesky-nginx:develop
          name: nginx
          ports:
          - containerPort: 80
          - containerPort: 443
          resources: {}
          volumeMounts:
          - mountPath: /var/local
            name: nginx-data
        restartPolicy: Always
        imagePullSecrets:
        - name: regcred
        volumes:
        - name: nginx-data
          persistentVolumeClaim:
            claimName: nginx-data
  status: {}
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    creationTimestamp: null
    labels:
      io.kompose.service: nginx-data
    name: nginx-data
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 100Mi
  status: {}
- apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    annotations:
      kompose.cmd: kompose convert -o kompose.yml -f docker-compose.yaml
      kompose.version: 1.8.0 (HEAD)
    creationTimestamp: null
    labels:
      io.kompose.service: servicebot
    name: servicebot
  spec:
    replicas: 1
    strategy:
      type: Recreate
    template:
      metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: servicebot
      spec:
        containers:
        - args:
          - sh
          - -c
          - node /usr/src/app/bin/wait-for-it.js db 5432  && npm run-script start
          env:
          - name: PORT
            value: '3000'
          - name: POSTGRES_DB_HOST
            value: 'db'
          - name: POSTGRES_DB_NAME
            value: 'xxxxxxxx'
          - name: POSTGRES_DB_PASSWORD
            value: 'xxxxxxxx'
          - name: POSTGRES_DB_PORT
            value: '5432'
          - name: POSTGRES_DB_USER
            value: 'xxxxxxxx'
          image: servicebot/servicebot
          name: servicebot
          resources: {}
          volumeMounts:
          - mountPath: /usr/src/app/uploads
            name: upload-data
          - mountPath: /usr/src/app/env
            name: environment-file
        restartPolicy: Always
        imagePullSecrets:
        - name: regcred
        volumes:
        - name: upload-data
          persistentVolumeClaim:
            claimName: upload-data
        - name: environment-file
          persistentVolumeClaim:
            claimName: environment-file
  status: {}
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    creationTimestamp: null
    labels:
      io.kompose.service: upload-data
    name: upload-data
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 100Mi
  status: {}
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    creationTimestamp: null
    labels:
      io.kompose.service: environment-file
    name: environment-file
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 100Mi
  status: {}
kind: List
metadata: {}
sjlongland commented 6 years ago

The following change to my service config fixed the problem:

stuartl@vk4msl-ws /tmp/ws-servicebot $ diff -u ../servicebot-kubernetes.yml servicebot-kubernetes.yml 
--- ../servicebot-kubernetes.yml    2018-03-05 09:54:54.281647303 +1000
+++ servicebot-kubernetes.yml   2018-03-05 10:26:42.478879301 +1000
@@ -200,7 +202,7 @@
             value: '5432'
           - name: POSTGRES_DB_USER
             value: 'sbuser'
-          image: servicebot/servicebot
+          image: servicebot/servicebot:version-0.8.3
           name: servicebot
           resources: {}
           volumeMounts:

It would appear there's a regression between this version and the latest.