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

Docker image crashes #40

Open
Outstep opened this issue Apr 28, 2020 · 12 comments
Open

Docker image crashes #40

Outstep opened this issue Apr 28, 2020 · 12 comments

Comments

@Outstep
Copy link

Outstep commented Apr 28, 2020

Hello,

I was trying to build the Docker version of the chatbot but it crashes out:


chatbot$ docker run --tty --publish 8080:8080 --name "chatbot" chatbot
The error seems to be:

java.lang.IllegalArgumentException: Could not resolve placeholder 'chatbot.slack.botToken' in value "${chatbot.slack.botToken}"

But not sure what that means.

Can you please help?
Thanks in advance

UPDATE: I have now installed Java 8 JDK and Maven 3.3 as per the Docker setup so that I can run it natively outside of Docker on the system and have attached the error from that attempt lower in this message list.

@RicardoUsbeck
Copy link
Contributor

@ram-g-athreya can help here

@RicardoUsbeck
Copy link
Contributor

Can you try to use a dummy config file
https://github.com/dbpedia/chatbot/wiki/Chatbot-Dummy-Configuration

@Outstep
Copy link
Author

Outstep commented Apr 29, 2020

Hello, I used the default Dummy-Configuration for the file and test since I do not have any actual keys yet and just to see if I can get the basic dbpedia chatbot to compile up and show something,

---------------configuration file " application.properties" in the src/main/resources" -------------
admin.username = admin
admin.password = password

chatbot.baseUrl = http://localhost:8080

chatbot.fb.appSecret = secret
chatbot.fb.verifyToken = token
chatbot.fb.pageAccessToken = access-token
chatbot.slack.botToken = slack-token

cloudant.url = http://dbpedia-chatbot-couchdb
cloudant.username = username
cloudant.password = password
cloudant.chatDB = chatDB
cloudant.feedbackDB = feedbackDB
cloudant.explorerDB = explorerDB

tmdb.apiKey = tmdb-key

wolfram.apiKey = wolfram-key

It seemed to compile (at least in the Docker build) and then I started it up and went to the localhost address

http://localhost:8080

and got this message now:


Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Apr 29 12:21:03 UTC 2020
There was an unexpected error (type=Internal Server Error, status=500).
Could not resolve placeholder 'chatbot.gaID' in value "${chatbot.gaID}"

Also tried adding "chatbot.gaID=gaID" to the configuration file as well, but that did not work either.

Maybe I need actual keys before it will come up?
Cheers

@Outstep
Copy link
Author

Outstep commented Apr 30, 2020

Hello,

I installed Maven and tried the manual build with Java but also got the same crash even after adding in the dummy.configuration

See attached file.
chatbotErrors.txt

@Outstep
Copy link
Author

Outstep commented May 1, 2020

Hi All,

I just tried to compile things on a resh Debian 9 with Java 11 JDK and Maven installed via "apt"

Added the "Dummy Configuration" to "src/main/resources/application.properties"
(https://github.com/dbpedia/chatbot/wiki/Chatbot-Dummy-Configuration)

In a non-docker environment, but have these errors now (See attached error file)
newTestErrors.txt

Also installed npm from "apt" as well.

lonnie@vmi208816:~/dbpedia-chatbot/chatbot$ java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)

lonnie@vmi208816:~/dbpedia-chatbot/chatbot$ mvn -version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.7, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-72-generic", arch: "amd64", family: "unix"

lonnie@vmi208816:~/dbpedia-chatbot/chatbot$ npm -version
3.5.2

@Outstep
Copy link
Author

Outstep commented May 1, 2020

One more question that I have here.

Does the chatbot require Couchdb to be installed and setup as well?

Thanks for any help that can be provided to get the base chatbot functioning as in the demo.

All help is truly apprciated.

@RicardoUsbeck
Copy link
Contributor

Hi @Outstep, we are currently looking into it. Please give us some more time

@Outstep
Copy link
Author

Outstep commented May 1, 2020 via email

@ram-viv-labs
Copy link

One more question that I have here.

Does the chatbot require Couchdb to be installed and setup as well?

Thanks for any help that can be provided to get the base chatbot functioning as in the demo.

All help is truly apprciated.

Hi @Outstep

Yes CouchDB is required for the chatbot and the corresponding configuration needs to be properly set up as part of the cloudant.* variables. Please give me some time to troubleshoot the issue you are facing.

@Outstep
Copy link
Author

Outstep commented May 1, 2020 via email

@ram-viv-labs
Copy link

Hi @Outstep

Thanks for your interest in the project. It is quite modular but the DB is a hard requirement. As you can see here we try to connect to CouchDB on startup:

https://github.com/dbpedia/chatbot/blob/master/src/main/java/chatbot/Application.java#L117-L119

Its been some time since I actually ran it locally so I need some time to brush up on the details.

@Anirban6756
Copy link

It looks like the error is related to Spring Boot and its property resolution. The error message indicates that it couldn't find the value for the property 'chatbot.slack.botToken' in your configuration.

Here are a few steps to troubleshoot this issue:

Check Configuration Files:
Ensure that you have a configuration file, possibly application.properties or application.yml, where the property chatbot.slack.botToken is defined. If you are using Docker, make sure that the configuration file is included in your Docker image or mounted correctly.

Property Placeholder Resolution:
Ensure that your property placeholder syntax is correct. In Spring Boot, it should be something like ${chatbot.slack.botToken}. Double-check the syntax in your configuration file.

Environment Variables:
If you are using environment variables for configuration, make sure that the environment variable CHATBOT_SLACK_BOT_TOKEN (or a similar name based on your property) is set.

Docker Image Configuration:
If you are using Docker, ensure that the configuration file is included in the Docker image. If you mount a volume, make sure that the file is available in the specified path inside the container.

Here's an example of what your application.properties file might look like:

properties
Copy code

application.properties

chatbot.slack.botToken=your_actual_bot_token_here
And if you prefer using environment variables:

properties
Copy code

application.properties

chatbot.slack.botToken=${CHATBOT_SLACK_BOT_TOKEN}
In your Docker setup, ensure that this file is either included in your Docker image or mounted correctly.

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