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

Code not saved #5

Open
Chluz opened this issue May 13, 2022 · 5 comments
Open

Code not saved #5

Chluz opened this issue May 13, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Chluz
Copy link

Chluz commented May 13, 2022

Describe the bug
When clicking save, and refreshing the page, the code is not saved and the text box is empty

To Reproduce
docker-compose deploy install, in swarm mode.
navigate to page, type code, click save, refresh page

Expected behavior
Clicking save would save the code, refreshing the page would show the code saved

Desktop (please complete the following information):

  • mac os or windows with FF

Additional context
tested both with Keycloak and traefik in front of cocopasty, and without (port redirection).
No errors in the logs whatsoever.

@Chluz Chluz added the bug Something isn't working label May 13, 2022
@MasterEvarior
Copy link
Owner

HI @Chluz
So I've never tested this with Swarm but I don't think the issue might be related to this.

mac os or windows with FF

I've just tested it with FF, works for me

tested both with Keycloak and traefik in front of cocopasty, and without (port redirection).
No errors in the logs whatsoever.

Could you provide the logs of the backend container? Maybe I find there something that could help me fix this issue.

It might take a week or so until I come back to this. Because thats the date where I get discharged from the military, hence I will have some time on my hands again :)

@Chluz
Copy link
Author

Chluz commented May 23, 2022

Hi @MasterEvarior

Thanks for your answer ! No worries, take all the time you need.
Here are some logs:

root@boat:/opt/cocopasty# docker logs -f cocopasty_cocopasty.1.ku8y437bwul1tew4xlrbjhs51
2022/05/21 22:00:57 [notice] 1#1: using the "epoll" event method
2022/05/21 22:00:57 [notice] 1#1: nginx/1.21.6
2022/05/21 22:00:57 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027) 
2022/05/21 22:00:57 [notice] 1#1: OS: Linux 5.4.0-109-generic
2022/05/21 22:00:57 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/05/21 22:00:57 [notice] 1#1: start worker processes
2022/05/21 22:00:57 [notice] 1#1: start worker process 7
2022/05/21 22:00:57 [notice] 1#1: start worker process 8
10.0.3.19 - - [23/May/2022:07:10:40 +0000] "GET / HTTP/1.1" 200 843 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0" "192.168.48.20, 192.168.48.20, 172.19.0.1"
10.0.3.19 - - [23/May/2022:07:10:40 +0000] "GET /css/app.53a86f42.css HTTP/1.1" 200 4733 "https://cp.luzzato.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0" "192.168.48.20, 192.168.48.20, 172.19.0.1"
10.0.3.19 - - [23/May/2022:07:10:40 +0000] "GET /js/chunk-vendors.7dfbc542.js HTTP/1.1" 200 1010282 "https://cp.luzzato.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0" "192.168.48.20, 192.168.48.20, 172.19.0.1"
10.0.3.19 - - [23/May/2022:07:10:40 +0000] "GET /js/app.5d9b8fdf.js HTTP/1.1" 200 3569 "https://cp.luzzato.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0" "192.168.48.20, 192.168.48.20, 172.19.0.1"
10.0.3.19 - - [23/May/2022:07:10:41 +0000] "GET /favicon.ico HTTP/1.1" 200 15406 "https://cp.luzzato.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0" "192.168.48.20, 192.168.48.20, 172.19.0.1"
10.0.3.19 - - [23/May/2022:07:11:07 +0000] "GET / HTTP/1.1" 200 843 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0" "192.168.48.20, 192.168.48.20, 172.19.0.1"

root@boat:/opt/cocopasty# docker logs -f cocopasty_backend.1.ep2dmdgs2auwu8rvhidurqxnc
time="2022-05-21T22:00:52Z" level=info msg="Log level to debug"
time="2022-05-21T22:00:52Z" level=info msg="Starting Cocopasty..."
time="2022-05-21T22:00:52Z" level=info msg="Starting web server..."
time="2022-05-23T07:05:22Z" level=debug msg="Received GET-Request"
time="2022-05-23T07:05:22Z" level=info msg="Log level to debug"
time="2022-05-23T07:05:22Z" level=debug msg="Creating connection to Redis..."
time="2022-05-23T07:05:22Z" level=info msg="REDIS_HOST: redis:6379"
time="2022-05-23T07:05:22Z" level=info msg="No Redis password was set"
time="2022-05-23T07:05:22Z" level=debug msg="Getting value from Redis..."
time="2022-05-23T07:05:22Z" level=error msg="redis: nil"
time="2022-05-23T07:05:22Z" level=debug msg="GET-Request failure, returning 500"
2022/05/23 07:05:22 http: superfluous response.WriteHeader call from main.handleGets (main.go:75)

root@boat:/opt/cocopasty# docker logs -f cocopasty_redis.1.np5yjd16te0w2hgqp611rcq45
1:C 21 May 2022 22:00:44.937 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 21 May 2022 22:00:44.937 # Redis version=7.0.0, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 21 May 2022 22:00:44.937 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 21 May 2022 22:00:44.937 * monotonic clock: POSIX clock_gettime
1:M 21 May 2022 22:00:45.004 * Running mode=standalone, port=6379.
1:M 21 May 2022 22:00:45.004 # Server initialized
1:M 21 May 2022 22:00:45.004 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 21 May 2022 22:00:45.006 * The AOF directory appendonlydir doesn't exist
1:M 21 May 2022 22:00:45.006 * Ready to accept connections

I hope this helps !

@MasterEvarior
Copy link
Owner

I have improved the logging process in the newest release, v1.2.1.

Could you try it again but with the image masterevarior/cocopasty-backend:1.2.1 in your docker-compose file?
Also enable debug logging with LOG_LEVEL: "debug".

I hope I can figure something out if you post the logs again after that 🎯

@Chluz
Copy link
Author

Chluz commented May 27, 2022

Thanks @MasterEvarior,

here are the new logs.

root@boat:/home/charles-luzzato# docker logs -f cocopasty_cocopasty.1.lnfyb3vquq5k5a8qfu6aq2bfp
2022/05/26 00:07:22 [notice] 1#1: using the "epoll" event method
2022/05/26 00:07:22 [notice] 1#1: nginx/1.21.6
2022/05/26 00:07:22 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027)
2022/05/26 00:07:22 [notice] 1#1: OS: Linux 5.4.0-109-generic
2022/05/26 00:07:22 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2022/05/26 00:07:22 [notice] 1#1: start worker processes
2022/05/26 00:07:22 [notice] 1#1: start worker process 9
2022/05/26 00:07:22 [notice] 1#1: start worker process 10
10.0.3.67 - - [27/May/2022:07:18:24 +0000] "GET / HTTP/1.1" 200 843 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:24 +0000] "GET /css/app.53a86f42.css HTTP/1.1" 200 4733 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:24 +0000] "GET /js/app.5d9b8fdf.js HTTP/1.1" 200 3569 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:24 +0000] "GET /js/chunk-vendors.7dfbc542.js HTTP/1.1" 200 1010282 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:25 +0000] "GET /favicon.ico HTTP/1.1" 200 15406 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"10.0.3.67 - - [27/May/2022:07:18:34 +0000] "GET / HTTP/1.1" 200 843 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:34 +0000] "GET /js/app.5d9b8fdf.js HTTP/1.1" 200 3569 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:34 +0000] "GET /js/chunk-vendors.7dfbc542.js HTTP/1.1" 200 1010282 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"
10.0.3.67 - - [27/May/2022:07:18:35 +0000] "GET /favicon.ico HTTP/1.1" 200 15406 "https://cp.luzzato.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0" "192.168.48.98, 192.168.48.98, 172.19.0.1"^C

root@boat:/home/charles-luzzato# docker logs -f cocopasty_backend.1.g2ru92jsjqfnd95m5i2t8r941
time="2022-05-26T00:07:16Z" level=info msg="Log level to info"
time="2022-05-26T00:07:16Z" level=info msg="Starting Cocopasty..."
time="2022-05-26T00:07:16Z" level=info msg="Log level to debug"
time="2022-05-26T00:07:16Z" level=debug msg="Creating connection to Redis..."
time="2022-05-26T00:07:16Z" level=info msg="REDIS_HOST: redis:6379"
time="2022-05-26T00:07:16Z" level=info msg="No Redis password was set"
time="2022-05-26T00:07:16Z" level=info msg="Connection to Redis was successfull"
time="2022-05-26T00:07:16Z" level=info msg="Starting web server..."

root@boat:/home/charles-luzzato# docker logs -f cocopasty_redis.1.zjjdsimpp9bo1zv8wslxjyjg6
1:C 27 May 2022 07:03:10.272 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 27 May 2022 07:03:10.272 # Redis version=7.0.0, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 27 May 2022 07:03:10.272 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 27 May 2022 07:03:10.273 * monotonic clock: POSIX clock_gettime
1:M 27 May 2022 07:03:10.274 * Running mode=standalone, port=6379.
1:M 27 May 2022 07:03:10.274 # Server initialized
1:M 27 May 2022 07:03:10.274 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 27 May 2022 07:03:10.274 * The AOF directory appendonlydir doesn't exist
1:M 27 May 2022 07:03:10.274 * Ready to accept connections

Its strange, it looks as if no requests are every making it to the backend.
I've checked and frontend can ping backend with no issues. For info this is the docker-compose file:

version: '3.2'
services:
  cocopasty:
    deploy:
      replicas: 1
      placement:
        constraints:
         - node.hostname == boat.ad.luzzato.com
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.cocopasty.rule=Host(`cp.luzzato.com`)"
        - "traefik.http.routers.cocopasty.entrypoints=websecure"
#        - "traefik.http.routers.cocopasty.tls.certresolver=letsencryptresolver"
        - "traefik.http.routers.cocopasty.tls=true"
        - "traefik.http.services.cocopasty.loadbalancer.server.port=80"
        - "traefik.http.routers.cocopasty.middlewares=keycloak" # <-- Require SSO login with Keycloak
    image: masterevarior/cocopasty-frontend:1.0.0
#    ports:
#      - "8783:80"
    environment:
      VUE_APP_BACKEND_PORT: 8080
      VUE_APP_BACKEND_HOST: "http://backend"
    networks:
     - traefik-net
     - cocopasty-internal


  backend:
    deploy:
      replicas: 1
      placement:
        constraints:
         - node.hostname == boat.ad.luzzato.com
    image: masterevarior/cocopasty-backend:1.2.1
#    ports:
#      - "8081:8080"
    environment:
      LOG_LEVEL: "debug"
      REDIS_HOST: "redis:6379"
#     REDIS_PASSWORD: "123" currently not used
    networks:
     - cocopasty-internal
 
  redis:
    deploy:
      replicas: 1
      placement:
        constraints:
         - node.hostname == boat.ad.luzzato.com
    image: 'redis:alpine'
    networks:
     - cocopasty-internal
     
networks:
  traefik-net:
    external: true
  cocopasty-internal:

@MasterEvarior
Copy link
Owner

Its strange, it looks as if no requests are every making it to the backend.

Indeed, if there would be any requests made it would look like this.

time="2022-05-27T14:53:36Z" level=debug msg="Incoming request: \n Method: 'POST' \n URI: '/'"
time="2022-05-27T14:53:36Z" level=debug msg="Setting value in Redis..."

I've checked and frontend can ping backend with no issues.

How did you test that?

For info this is the docker-compose file:

I don't have that much experience with custom networks on docker. Have you tried it once without its own network, just to see if it works?
I can image that the connection maybe doesn't work like this VUE_APP_BACKEND_HOST: "http://backend" for custom networks?

As a last ditch effort you could maybe check the browser console for any error or warnings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants