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

Errors when trying to setup with given commands in Readme #10

Open
misteu opened this issue Apr 16, 2023 · 7 comments
Open

Errors when trying to setup with given commands in Readme #10

misteu opened this issue Apr 16, 2023 · 7 comments

Comments

@misteu
Copy link

misteu commented Apr 16, 2023

I uploaded everything to my webserver, created a mariaDB database + installed Java (because my debian did not have it yet) but the setup does not work for me.

Are the commands in the Readme up to date?

I tried these

# Create database tables
bin/server -DdropAndCreateNewDb

# Create admin user
bin/server -DcreateAdminUser

# Run application
bin/server

But already the first throws a lot of errors. I am not quite sure what to look for.

E.g.: One error marked red says "[error] application - Error when parsing accounting-config.yml: java.nio.charset.MalformedInputException: Input length = 1"

Really looking forward to you reply as I'm really interested in trying this tool :)

@nymanjens
Copy link
Owner

Are the commands in the Readme up to date?

Yes, they should be working.

E.g.: One error marked red says "[error] application - Error when parsing accounting-config.yml: java.nio.charset.MalformedInputException: Input length = 1"

Looks like the server cannot parse accounting-config.yml. A quick search on the error seems to indicate that it is some kind of encoding issue. Can you try to change the file's encoding to utf-8? Or can you share the file here?

@misteu
Copy link
Author

misteu commented Apr 17, 2023

Hi, thanks for the quick reply!

checked the encoding using file, it says:

conf/accounting-config.yml: UTF-8 Unicode text

Regarding the contents of it, I did not change anything of it. It's the same that is in the release's zip archive.

@nymanjens
Copy link
Owner

I tried to reproduce this with the following steps:

  • Download and unpack the latest release
  • In application.conf: Configure the database and change play.http.secret.key
  • Run bin/server -DdropAndCreateNewDb and the subsequent commands

This all works fine.

Could you give me the steps you're doing to reproduce this?

@misteu
Copy link
Author

misteu commented Apr 19, 2023

OK, I'm doing it right now:

  • downloaded archived release
  • unpacked on my machine and renamed the folder to facto
  • uploaded it to my webserver's /var/www/ via FTP
  • logged into my webserver via ssh
  • created the database, user and granted privileges to user using this guide: https://linuxhint.com/create-mariadb-user/
  • opened the config via nano conf/application.conf
  • changed db.default.url="jdbc:mysql://localhost/facto?user=mysqluser&password=mysqlpassword" to contain the username + password set in the previous step
  • did choose some random values for play.http.secret.key and app.setup.defaultPassword
  • saved everything
  • running bin/server -DdropAndCreateNewDb-> permission denied
  • running chmod -R 775 for all the three subdirectories in my facto folder -> something happens
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/var/www/facto/lib/com.google.inject.guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] application - Creating Pool for datasource 'default'
[info] p.a.d.DefaultDBApi - Database [default] connected at **********

after that a lot of errors are appearing, starting with: application - Error when parsing accounting-config.yml: java.nio.charset.MalformedInputException: Input length = 1

I will try now different encodings (other than UTF-8) as described here: https://stackoverflow.com/questions/26268132/all-inclusive-charset-to-avoid-java-nio-charset-malformedinputexception-input

@misteu
Copy link
Author

misteu commented Apr 19, 2023

OK no idea where I should continue. I'm unwilling to just randomly try other file encoding.

Maybe anything of my VPS setup (Java, etc) is different or incompatible? Let me know if you have any other ideas.

nymanjens added a commit that referenced this issue Apr 20, 2023
@nymanjens
Copy link
Owner

On your Unix machine, could you please run the following code:

mkdir facto
cd facto
wget https://github.com/nymanjens/facto/releases/download/v3.70/release-v3.70.tar.gz
tar -xf release-v3.70.tar.gz

echo '
  play {
    http.secret.key="abcabcabcabcabcabcabcabc"
    i18n.langs = ["en"] # Supported: "en" and "nl"
    http.session.maxAge = 60d
  }
  db.default {
    # In memory database
    slick.profile = "slick.jdbc.H2Profile$"
    driver = org.h2.Driver
    url = "jdbc:h2:mem:test1"
    connectionPool = disabled
    keepAliveConnection = true
    logStatements = true
  }
  app {
    accounting.configYamlFilePath = "conf/accounting-config.yml"
    setup.defaultPassword = "changeme"
  }
' > conf/application.conf

bin/server -Dhttp.port=9007

It starts the server with an In memory databse. It's useless for production, but it should help us narrow down what's wrong with accounting-config.yml.

@Logfro Logfro mentioned this issue Jan 11, 2024
@Logfro
Copy link

Logfro commented Jan 11, 2024

For me it fixed running it with LC_ALL=C.UTF-8 LANG=C.UTF-8 bin/server

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