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

Unable to connect to localhost:3030 (Connection refused) #509

Closed
mhabsaoui opened this issue Oct 14, 2017 · 2 comments
Closed

Unable to connect to localhost:3030 (Connection refused) #509

mhabsaoui opened this issue Oct 14, 2017 · 2 comments

Comments

@mhabsaoui
Copy link

mhabsaoui commented Oct 14, 2017

Hi,
I'm using the official docker image "php:apache" to test the Skomos application (https://github.com/NatLibFi/Skosmos). This php-apache container must have access throug http to another docker container within Jena-Fuseki (https://store.docker.com/community/images/stain/jena-fuseki) running a sparql triplestore server endpoint.

The problem is that php-apache container triggers an error when trying to access the jena-fuseki container throug this URL => GET http://localhost:3030/ds/data/Biodiversite_ark :

Fatal error: Uncaught EasyRdf_Exception: Unable to connect to localhost:3030 (Connection refused) in /var/www/html/vendor/easyrdf/easyrdf/lib/EasyRdf/Http/Client.php:423 Stack trace: #0 /var/www/html/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php(276): EasyRdf_Http_Client->request() #1 /var/www/html/vendor/easyrdf/easyrdf/lib/EasyRdf/Sparql/Client.php(120): EasyRdf_Sparql_Client->request('query', 'SELECT ?cs ?lab...') #2 /var/www/html/model/sparql/GenericSparql.php(72): EasyRdf_Sparql_Client->query('SELECT ?cs ?lab...') #3 /var/www/html/model/sparql/GenericSparql.php(653): GenericSparql->query('SELECT ?cs ?lab...') #4 /var/www/html/model/Vocabulary.php(210): GenericSparql->queryConceptSchemes('en') #5 /var/www/html/model/Vocabulary.php(227): Vocabulary->getConceptSchemes() #6 /var/www/html/model/Vocabulary.php(139): Vocabulary->getDefaultConceptScheme() #7 /var/www/html/vendor/twig/twig/lib/Twig/Template.php(680): Vocabulary->getInfo('en') #8 /tmp/skosmos-template-cache/33/33ee68b76e69dfd64d470b6af94c1e4974cd1e8211c in /var/www/html/view/vocab-shared.twig on line 9

The skosmos container logs on making http request:

skosmos | 172.18.0.1 - - [14/Oct/2017:16:48:19 +0000] "GET /Biodiversit%C3%A9_ARK/en/ HTTP/1.1" 200 1065 "http://localhost:8080/en/" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"

Wheras, a sparql client (e.g. YASGUI) can perfectly access the jena-fuseki container throug this URL => POST http://localhost:3030/ds/sparql
The fuseki container logs on receiving from from sparql client:

FYI:

  • docker-compose.yml:

`
version: '2'
services:
fuseki:
container_name: fuseki
image: stain/jena-fuseki
ports:
- 3030:3030
environment:
- ADMIN_PASSWORD="pw"
volumes:
- ${PWD}/fuseki:/fuseki
restart: always

skosmos:
container_name: skosmos
links:
- fuseki
build:
context: .
ports:
- 8080:80
volumes:
- ${PWD}/Skosmos:/var/www/html
`

  • skosmos Dockerfile (php-apache) :
    FROM php:apache RUN apt-get update && apt-get install -y locales && \ locale-gen fr_FR.UTF-8 && \ a2enmod rewrite && \ docker-php-ext-install gettext mbstring

PS: here NatLibFi/Skosmos#635 is already discussed this problem from the Skosmos point of view, but seems more Network/socket related...

Thanks.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 14, 2017

This topic could be a start as an explanation : #320

OK, by modifying the setting "localhost" to "fuseki" on skosmos app container => it seems better now 👍

@GabrielPCS
Copy link

En la terminal inspecciona la ip del contenedor de la base de datos:

docker inspect [db_caontainer] | grep IPAddress

usas la ip que te arroje como $dbhost

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

2 participants