CarbonLDP / carbonldp-workbench

Workbench to administer an on premise installation of Carbon LDP's platform
Other
2 stars 3 forks source link

Gateway Timeout There was a problem processing the request. Error when trying to use my Carbon LDP Workbench with a platform that was not deployed on port 8083 #179

Closed alex-arriaga closed 5 years ago

alex-arriaga commented 5 years ago

Hi, I created a Carbon LDP platform instance with 8084 as my port, instead of the 8083, using a command similar to this:

docker run -d --name carbonldp-platform-v5 -p 8084:8083 \
    -v /Users/alex/carbon-v5:/opt/carbonldp/shared \
    carbonldp/carbonldp-platform:5 \
        --carbonldp.contact.first-name="Alex" \
        --carbonldp.contact.last-name="Arriaga" \
        --carbonldp.contact.email="alex@example.com" \
        --carbonldp.contact.company="Company"

If I visit: http://localhost:8084/ I see my instance running as expected.

Then, I run a Carbon LDP Workbench container changing the port from 8000 to 8001, as follows:

docker run -d --name carbonldp-workbench-v5 -p 8001:80 \
        -e "CARBON_HOST=localhost:8084" \
        -e "CARBON_PROTOCOL=http" \
        carbonldp/carbonldp-workbench:5

When I visit: http://localhost:8001/ I am getting an error message:

Gateway Timeout There was a problem processing the request. Error: 504 Status: 504 - Gateway Timeout URI: http://localhost:8083/.system/platform/

screen shot 2018-12-17 at 2 44 40 pm

It seems my workbench is trying to connect to port 8083 (default) instead of my custom port 8084.

MiguelAraCo commented 5 years ago

The variables were changed although the old ones should work too, will open a separate issue for that. For now, please use these env variables:

alex-arriaga commented 5 years ago

Hi @MiguelAraCo

Thank you for your response. I tried with these variables instead:

docker run -d --name carbonldp-workbench-v5 -p 8001:80 \
        -e "CARBONLDP_HOST=localhost:8084" \
        -e "CARBONLDP_PROTOCOL=http" \
        carbonldp/carbonldp-workbench:5

And getting the same error.

BTW, the "old" variables are referenced in this documentation https://carbonldp.com/documentation/v5.x.x/quick-start-guide/

MiguelAraCo commented 5 years ago

Just confirmed the issue. It seems to be affecting only the latest version so please use version 5.0.0 with the old ENV variables for now.

I'll update this issue as soon as the problem gets fixed.

By the way, if you intend to expose the platform in some other host (like your command suggests), make sure to set the arguments. See: https://carbonldp.com/documentation/v5.x.x/platform/startup/#arguments-reference

alex-arriaga commented 5 years ago

Thank you Miguel, I just tried again with these settings (5.0.0):

docker run -d --name carbonldp-platform-v5 -p 8084:8083 \
    -v /Users/alex/carbon-v5:/opt/carbonldp/shared \
    carbonldp/carbonldp-platform:5.0.0 \
        --carbonldp.contact.first-name="Alex" \
        --carbonldp.contact.last-name="Arriaga" \
        --carbonldp.contact.email="alex@example.com" \
        --carbonldp.contact.company="Company"

docker run -d --name carbonldp-workbench-v5 -p 8001:80 \
        -e "CARBON_HOST=localhost:8084" \
        -e "CARBON_PROTOCOL=http" \
        carbonldp/carbonldp-workbench:5.0.0

And getting: screencapture-localhost-8001-2018-12-17-16_12_51

Going to http://localhost:8084/.system/platform/ using my web browser returns:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://localhost:8083/.system/platform/">
<rdf:type rdf:resource="http://www.w3.org/ns/ldp#BasicContainer"/>
<rdf:type rdf:resource="http://www.w3.org/ns/ldp#Container"/>
<rdf:type rdf:resource="http://www.w3.org/ns/ldp#RDFSource"/>
<rdf:type rdf:resource="http://www.w3.org/ns/ldp#Resource"/>
<rdf:type rdf:resource="https://carbonldp.com/ns/v1/platform#Document"/>
<rdf:type rdf:resource="https://carbonldp.com/ns/v1/platform#RequiredSystemDocument"/>
<rdf:type rdf:resource="https://carbonldp.com/ns/v1/platform#Platform"/>
<membershipResource rdf:resource="http://localhost:8083/.system/platform/" xmlns="http://www.w3.org/ns/ldp#"/>
<created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" xmlns="https://carbonldp.com/ns/v1/platform#">2018-12-17T20:27:55.195Z</created>
<modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" xmlns="https://carbonldp.com/ns/v1/platform#">2018-12-17T20:27:55.195Z</modified>
</rdf:Description>
<rdf:Description rdf:nodeID="node1cuv3rt89x20">
<rdf:type rdf:resource="https://carbonldp.com/ns/v1/platform#PlatformInstance"/>
<rdf:type rdf:resource="https://carbonldp.com/ns/v1/platform#VolatileResource"/>
<buildDate rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" xmlns="https://carbonldp.com/ns/v1/platform#">2018-09-22T08:50:52Z</buildDate>
<version xmlns="https://carbonldp.com/ns/v1/platform#">5.0.0</version>
</rdf:Description>
<rdf:Description rdf:about="http://localhost:8083/.system/platform/">
<instance rdf:nodeID="node1cuv3rt89x20" xmlns="https://carbonldp.com/ns/v1/platform#"/>
</rdf:Description>
</rdf:RDF>
alex-arriaga commented 5 years ago

I will try passing the "arguments" when running the container...

MiguelAraCo commented 5 years ago

Since the data was already initialized I suggest you erase the data in your volume before creating the container again.

MiguelAraCo commented 5 years ago

The issue has been fixed as is now available in the latest version of the Docker images.

alex-arriaga commented 5 years ago

Running my containers with latest versions of both platform and workbench gave me the same kind of error:

docker pull carbonldp/carbonldp-platform:5
docker pull carbonldp/carbonldp-workbench:5

docker run -d --name carbonldp-platform-v5 -p 8084:8083 \
    -v /Users/alex/carbon-v5:/opt/carbonldp/shared \
    carbonldp/carbonldp-platform:5 \
        --carbonldp.contact.first-name="Alex" \
        --carbonldp.contact.last-name="Arriaga" \
        --carbonldp.contact.email="alex@example.com" \
        --carbonldp.contact.company="Company"

docker run -d --name carbonldp-workbench-v5 -p 8001:80 \
        -e "CARBONLDP_HOST=localhost:8084" \
        -e "CARBONLDP_PROTOCOL=http" \
        carbonldp/carbonldp-workbench:5

screen shot 2018-12-17 at 6 15 05 pm

MiguelAraCo commented 5 years ago

You are still not declaring the arguments the platform needs to know how it is going to be exposed. Particularly, you are missing: --server.exposed.host. Be sure to erase your data directory so the platform can recreate the information after you recreate the container.

alex-arriaga commented 5 years ago

After removing the "data" and "version" and setting both the domain and port as follows, it is working:

docker run -d --name carbonldp-platform-v5 -p 8084:8083 \
    -v /Users/alex/carbon-v5:/opt/carbonldp/shared \
    -e "server.exposed.host=localhost" \
    -e "server.exposed.port=8084" \
    carbonldp/carbonldp-platform:5 \
        --carbonldp.contact.first-name="Alex" \
        --carbonldp.contact.last-name="Arriaga" \
        --carbonldp.contact.email="alex@example.com" \
        --carbonldp.contact.company="Company"

docker run -d --name carbonldp-workbench-v5 -p 8001:80 \
        -e "CARBONLDP_HOST=localhost:8084" \
        -e "CARBONLDP_PROTOCOL=http" \
        carbonldp/carbonldp-workbench:5

Best regards.

MiguelAraCo commented 5 years ago

Just for the record, you can also declare those arguments like the other arguments you are passing (instead of environment variables):

docker run -d --name carbonldp-platform-v5 -p 8084:8083 \
    -v /Users/alex/carbon-v5:/opt/carbonldp/shared \
    carbonldp/carbonldp-platform:5 \
        --server.exposed.host="localhost" \
        --server.exposed.port=8084 \
        --carbonldp.contact.first-name="Alex" \
        --carbonldp.contact.last-name="Arriaga" \
        --carbonldp.contact.email="alex@example.com" \
        --carbonldp.contact.company="Company"
alex-arriaga commented 5 years ago

Sweet, thank you @MiguelAraCo