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

Movie not playing #718

Open
kerberjg opened this issue Jan 10, 2019 · 6 comments
Open

Movie not playing #718

kerberjg opened this issue Jan 10, 2019 · 6 comments

Comments

@kerberjg
Copy link

Issue description

After attempting to upload and play a movie (not happening with TV series), the movie does not play, displaying a "Internal Server Error" message in a red popup.

Inspecting the HTTP request reveals that the failing request is made to the URL/video/show.json?id=1. Interestingly enough, requests to /movie/show.json?id=1 are evaluated correctly (only on other pages, it does not happen in the player). Stack trace is at the end of this report.

When assigning the same file to a TV series episode, the file is played correctly, and requests to /video/show.json?id=3 do not fail.


Sometimes the connection to the DB times out as well, with the following message in MariaDB:

[Warning] Aborted connection 34 to db: 'streama' user: 'streama' host: '172.19.0.4' (Got timeout reading communication packets)

The result of that is the whole application responding with {"message":"Internal server error","error":500} to ANY HTTP request, causing the web interface to not show anymore either. I forgot to save the stack trace of that, however I remember seeing: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 636,743 milliseconds ago. The last packet sent successfully to the server was 636,743 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

Steps to Reproduce

  1. Create a movie
  2. Upload a file for the movie
  3. Attempt to play the movie

Expected Behaviour

Movie playing (without any other unexpected behavior)

Actual Behaviour

Movie does not play; sometimes DB connection times out, doesn't reconnect, causing the whole server to respond with 500 to anything.

Environment Information

  • Operating System: Docker container of 'gkiko/streama' (Linux container, host OS irrelevant)
  • Streama version: v1.6.0-FINAL
  • DB: MariaDB 10.3.12

Here's the docker-compose.yml used:

version: '2'

services:
    streama:
        image: 'gkiko/streama:v1.6.0-FINAL'
        working_dir: '/app'
        entrypoint: 'java'
        command: ["-Dgrails.env=mysql", "-jar", "streama.war"]
        hostname: streama
        ports:
            - 8080:8080
        environment:
            - ACTIVE_PROFILE=mysql
            - MYSQL_HOST=mysql
            - MYSQL_DATABASE=streama
            - MYSQL_USER=streama
            - MYSQL_PASSWORD=streama_password
        restart: always
        volumes:
            - ./data:/data/streama
        links:
            - mysql
        depends_on:
            - mysql
    mysql:
        image: 'mariadb:10'
        hostname: mysql
        restart: always
        volumes:
            - ./mysql_data:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=password
            - MYSQL_DATABASE=streama
            - MYSQL_USER=streama
            - MYSQL_PASSWORD=streama_password
        expose:
            - 3306

Stack trace

https://pastebin.com/3Jj5mk84

@kerberjg
Copy link
Author

UPDATE: I was able to catch the stack trace of the app breaking, it happened about 10 minutes after the occurrence of the movie playing issue

It's above 10k lines, so I'll paste the most significant portions below. I can provide the full file via email if necessary.

2019-01-10T19:33:07.014386440Z ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - The last packet successfully received from the server was 785,440 milliseconds ago.  The last packet sent successfully to the server was 785,440 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

2019-01-10T19:33:07.028475719Z ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - No operations allowed after connection closed.

2019-01-10T19:33:07.034434001Z ERROR org.springframework.transaction.support.TransactionTemplate - Application exception overridden by rollback exception

@kerberjg
Copy link
Author

UPDATE 2: Seems to be another instance of #161 happening.

I checked the application.yml and indeed, the connection properties used in the production environment have not been used for the mysql environment.

It also seems to be related to #686, #662 (same stack trace) and #670 (same behavior)

I'll try investigating a bit more.

@dularion
Copy link
Member

thanks for looking into this!
Can you reproduce this on the demo-version of the streama as well? https://demo.streamaserver.org/login/auth

that way, i could look into the stacktrace as well

@kerberjg
Copy link
Author

kerberjg commented Apr 8, 2019

Sorry I forgot about this one! I can attempt replicating it today, I'll report back with any potential findings.

What database does the demo server run on? If it's H2, I'd assume this issue will not be replicable there

@kieransouth
Copy link

Hello

I am also having this issue. I am running this on Docker with the same docker-compose.yml posted above (with a few extra labels). This happens for any action (not just watching a movie) and only happens after around 20 minutes of the container running.

I have added a dirty fix by using an autoheal container alongside this one and adding a healthcheck to the streama docker-compose.yml but obviously this isn't ideal.

@kieransouth
Copy link

kieransouth commented May 7, 2019

Figured this out.

I noticed I wasn't using the latest image so I changed my image in my docker-compose.yml to image: 'gkiko/streama:latest'.

Also changed the ACTIVE_PROFILE environment variable to docker rather than mysql and changed the command to command: ["-Dgrails.env=docker", "-jar", "streama.jar"] (notice since it's using the latest version it uses .jar rather than .war and the -Dgrails.env is set to docker now).

I also mounted a volume for the database because it won't be using the mariadb provided in the docker-compose.yml anymore.

That's it - no more 500 errors after 20 mins of runtime. Hope this helps anyone else using the same docker-compose file.

Also, love this project. Thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants