Kystverket / IMO-Maritime-Single-Window

An IMO coordinated project developing a generic Maritime Single Window.
MIT License
29 stars 16 forks source link

500 Internal server error #96

Closed mgalil closed 5 years ago

mgalil commented 5 years ago

After I have installed the latest version, I get login screen and entered credentials agent@imo-msw.org/agent, faced the following error "500 Internal server error" and imo logo did not displayed.

62276021-6dd51380-b443-11e9-924d-7ec3887a2aaf 1

mgalil commented 5 years ago

image

all tables are from imomsw database.

bardlokas commented 5 years ago
"JwtIssuerOptions": {
    "Issuer": "placeholderIssuer",
    "Audience": "localhost"
}

Add this to the bottom of your appsettings file. so it looks like this:

{ "ConnectionStrings": { "OpenSSN": "User ID=postgres;Password=******;Host=localhost;Port=5432;Database=imomsw;", "UserDatabase": "" }, "AppSettings": { "Secret" : "TopSekritSecretToken" }, "JwtIssuerOptions": { "Issuer": "placeholderIssuer", "Audience": "localhost" } }

mgalil commented 5 years ago

Unfortunately .. get the same error

bardlokas commented 5 years ago

How is your appsettings file now? Copy the entire file please

mgalil commented 5 years ago

appsettings.json.txt

bardlokas commented 5 years ago

You are missing the JwtIssuerOptions i mentioned in my above comment.

mgalil commented 5 years ago

like this:

appsettings.json.txt

mgalil commented 5 years ago

image

bardlokas commented 5 years ago

That error means that your password for the postgres user is wrong. I see in your appsettings you have written "password=*****", remove this So it only says; "OpenSSN": "User ID=user;Host=localhost;Port=5432;Database=imomsw;",

Unless you plan on using another user you set up yourself, then you have to write the password in that field.

mgalil commented 5 years ago

{ "ConnectionStrings": { "OpenSSN": "User ID=user;Host=localhost;Port=5432;Database=imomsw;", "UserDatabase": "" }, "AppSettings": { "Secret" : "TopSekritSecretToken" }, " JwtIssuerOptions": { "Issuer": "placeholderIssuer", "Audience": "localhost" } }

image

bardlokas commented 5 years ago

It says that your user has a password. So add the password you chose { "ConnectionStrings": { "OpenSSN": "User ID=user;Password=YOURPASSWORDHERE;Host=localhost;Port=5432;Database=imomsw;", "UserDatabase": "" }, "AppSettings": { "Secret" : "TopSekritSecretToken" }, " JwtIssuerOptions": { "Issuer": "placeholderIssuer", "Audience": "localhost" } }

mgalil commented 5 years ago

I applied the above appsettings.json you mentioned above, get the same error :

image

bardlokas commented 5 years ago

It says that the password is wrong. Are you sure you wrote the correct password? What did you write as a password when creating the user? And are you writing the same password in the appsettings?

mgalil commented 5 years ago

the password for postgres user is "Root1234" as written in appsettings.

bardlokas commented 5 years ago

But you aren't using the postgres user. You are referencing a user named "user". Did you create a user in pgadmin named "postgres" with the password "Root1234" ? If so, use that in the appsettings, not "user".

mgalil commented 5 years ago
bardlokas commented 5 years ago

It says you are using the user named "user" in your appsettings file. You have to use a user that exists.

mgalil commented 5 years ago

Error : Object Object

image image

mgalil commented 5 years ago

no red text, just green "Info" lines.

bardlokas commented 5 years ago

Can you share your appsettings again? The way it looks now I mean

mgalil commented 5 years ago

appsettings.json.txt

bardlokas commented 5 years ago

You have a space " JwtIssuerOptions" it should be "JwtIssuerOptions"

bardlokas commented 5 years ago

Did this fix your issues?

mgalil commented 5 years ago

thank you very much Bardlokas it's working with server and client .. but there is a bit problem with client access, all icons and images not appeared as below:

image

image

bardlokas commented 5 years ago

Linking between client/server projects or something might not have been built correctly. If you open localhost:5000 it should display correctly.

mgalil commented 5 years ago

with localhost:5000 all images displayed correctly, but the problem is only with localhost:4201

bardlokas commented 5 years ago

Rename the folder at this location: IMO-Maritime-Single-Window\IMOMaritimeSingleWindow\Client\src\assets\images\Flags to "flags". As in: set it all to lower case.

mgalil commented 5 years ago

It's working .. thank you very bardlokas, Now and finally I can close this issue, thank you.

mgalil commented 5 years ago

Hi bardlokas .. I can access client (localhost:4201) remotely but server (localhost:5000) only locally, is that only the difference between them, client for remote access and server for local access.