Hi Tim,

Before I posted my problem here I tried everything as as outlined in 
https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-FrontendInstallation
 
It is not working without pm2. 

*/dspace-ui-deploy*$ node ./dist/server/main.js

Building *production* app config

Overriding app config with /dspace-ui-deploy/config/config.yml

Overriding app config with /dspace-ui-deploy/config/config.prod.yml

Angular *config.json* file generated correctly at 
*/dspace-ui-deploy/dist/browser/assets/config.json* 


Environment extended with app config


dspace-angular

Version: 7.5.0

Environment: Production


[HPM] Proxy created: /  -> https://<nameOfMyServer>/server/sitemaps

[08:20:25 GMT+0200 (Mitteleuropäische Sommerzeit)] Listening at 
http://localhost:4000/

If I do:

wget -v http://localhost:4000

--2023-05-23 08:33:09--  http://localhost:4000/

Auflösen des Hostnamens localhost (localhost) … ::1, 127.0.0.1

Verbindungsaufbau zu localhost (localhost)|::1|:4000 … fehlgeschlagen: 
Verbindungsaufbau abgelehnt.

Verbindungsaufbau zu localhost (localhost)|127.0.0.1|:4000 … verbunden.

HTTP-Anforderung gesendet, auf Antwort wird gewartet … 

Then nothing happens. And I mean nothing. I can see the connection in 
netstat
tcp        0      0 localhost:4000          localhost:46794         
VERBUNDEN   dspace     784425     44998/node

And I don't get an answer where I started wget. And I am patient. After 
more then 15 minutes I get 

GET / - - ms - -
on the console where I started node
an other 15 minutes:

Lesefehler (Die Wartezeit für die Verbindung ist abgelaufen) beim Vorspann 
(header).

Erneuter Versuch.


--2023-05-23 08:48:10--  (Versuch: 2)  http://localhost:4000/

Verbindungsaufbau zu localhost (localhost)|127.0.0.1|:4000 … verbunden.

HTTP-Anforderung gesendet, auf Antwort wird gewartet …

It starts a third try, before it gives up. 
And no clue what is wrong. I did the test:

*dspace-angular*$ yarn test:rest

*yarn run v1.22.19*

$ ts-node --project ./tsconfig.ts-node.json scripts/test-rest.ts

Building *production* app config

Overriding app config with /home/dspace/dspace-angular/config/config.yml

Overriding app config with 
/home/dspace/dspace-angular/config/config.prod.yml

...Testing connection to REST API at https://<nameOfMyServer>/server/api...


RESPONSE: 200 200 


Checking JSON returned for validity...

"dspaceVersion" = DSpace 7.5

"dspaceUI" = https://<nameOfMyAngularServer>

"dspaceServer" = https://<nameOfMyServer>/server

"dspaceServer" property matches UI's "rest" config? true

Does "/api" endpoint have HAL links ("_links" section)? true

Done in 5.38s.

In the Apache Config I included 
ProxyPass / http://localhost:4000/
ProxyPassReverse / http://localhost:4000/

I can't do more then doing exactly what is written in the installation 
 instructions. So what is wrong?

Kind Regards 
Christiane

DSpace Technical Support schrieb am Mittwoch, 17. Mai 2023 um 21:12:32 
UTC+2:

> Hi Christiane,
>
> Those warnings when running "yarn install" are normal behavior.  They can 
> be ignored. They are not causing any issues.
>
> As I mentioned previously, you might want to try starting up the UI 
> *without* PM2, just to verify it's working properly standalone & trying to 
> access it on the same machine that is is running on using 
> http://localhost:4000/.  If it works standalone, then something in your 
> PM2 configuration is the problem.  If it doesn't work standalone, then it 
> might give you more useful errors to work with.   As I mentioned, this is 
> documented in step 6 of the Installation for the UI (called the "Quick 
> Start"): 
> https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-FrontendInstallation
>
> My best guess is that either the UI is having trouble contacting the 
> backend... or something in your proxy configuration (in either PM2 or 
> Apache) is incorrect and is causing things to get confused.
>
> Tim
>
> On Friday, May 12, 2023 at 2:03:25 AM UTC-5 c...@leibniz-psychology.org 
> wrote:
>
>> Hi there,
>>
>> I decided to start with a fresh installation of the angular frontend. I 
>> have following version installed:
>>  npm version: 9.6.6
>>  yarn version: 1.22.19
>>  node version: v16.20.0
>>
>> execpt for a new config.prod.yml in the config directory,  with the 
>> minimal configuration as stated in the install guide, nothing changed in 
>> the dspace-angular code checked out from git with tag dspace-7.5
>>
>> If I do *yarn install* I get warnings:
>>   yarn install v1.22.19
>>   [1/4] Resolving packages...
>>   [2/4] Fetching packages...
>>   [3/4] Linking dependencies...
>>   warning " > boot...@4.6.2" has unmet peer dependency "jqu...@1.9.1 - 3".
>>   warning " > boot...@4.6.2" has unmet peer dependency 
>> "popper.js@^1.16.1".
>>   warning " > ngx-sor...@11.1.0" has incorrect peer dependency 
>> "@angular/common@^11.0.0".
>>   warning " > ngx-sor...@11.1.0" has incorrect peer dependency 
>> "@angular/core@^11.0.0".
>>   [4/4] Building fresh packages...
>>   Done in 124.82s.
>>
>> Might this be the reason, why it is not working for me. How can I fix 
>> this. I am new to angular, node,js, yarn &  co
>>
>> Kind regards
>> Christiane
>>
>>
>>
>> Christiane Baier schrieb am Donnerstag, 11. Mai 2023 um 11:34:34 UTC+2:
>>
>>> Hi Tim,
>>> I went over the troubleshooting guide, but this doesn't help as I don't 
>>> get any content in the browser, so nothing to see. In the apache logs, I 
>>> can see, that the host is reached: 
>>> "GET / HTTP/1.1" 502 6753
>>> but it hrows an error and the following is displayed in my browser:
>>>     The proxy server received an invalid response from an upstream 
>>> server.
>>>     The proxy server could not handle the request
>>>     Reason: *Error reading from remote server*
>>> So no way to see any errors in the browser's Developer Tools.
>>> I tried all the suggested steps in the troubleshooting section
>>> I can reach my backend  wget -v 
>>> "https://<my-backends-server-name>/server/api" and get an answer 
>>> similar to the one when calling wget -v "
>>> https://api7.dspace.org/server/api";
>>> I did yarn test:rest as suggested in "
>>>
>>>    1. From [dspace-angular], run yarn test:rest This script will 
>>>    attempt a basic Node.js connection to the REST API that is configured in 
>>>    your "config.prod.yml" file and validate the response."
>>>
>>> and it went well.
>>>
>>> If I stop the app with pm2 and start it with
>>> node ./dist/server/main.js
>>> I get:
>>>    Building production app config
>>>    Overriding app config with /dspace-ui-deploy/config/config.yml
>>>    Overriding app config with /dspace-ui-deploy/config/config.prod.yml
>>>   Angular config.json file generated correctly at 
>>> /dspace-ui-deploy/dist/browser/assets/config.json 
>>>
>>>   Environment extended with app config
>>>
>>>   dspace-angular
>>>   Version: 7.5.0
>>>   Environment: Production
>>>
>>>   [HPM] Proxy created: /  -> 
>>> https://<my-backends-server-name>/server/sitemaps
>>>   [10:35:15 GMT+0200 (Mitteleuropäische Sommerzeit)] Listening at 
>>> http://localhost:4000/
>>>
>>> But if I try to reach the site in the browser - same as before. 
>>> console where I started main.js shows:
>>> GET / - - ms - -
>>> 1 rules skipped due to selector errors:
>>>   .custom-file-input:lang(en)~.custom-file-label -> unmatched 
>>> pseudo-class :lang
>>> GET /favicon.ico 404 2723.419 ms - -
>>> I get no answer and I get nothing on the console to get a hint what is 
>>> wrong.
>>> netstat -taupe | grep 4000 
>>> shows
>>> tcp        0      0 localhost:4000          0.0.0.0:*               
>>> LISTEN      dspace     119606     6143/node           
>>> tcp        0      0 localhost:60110         localhost:4000         
>>>  VERBUNDEN   www-data   119839     5984/apache2        
>>> tcp        0      0 localhost:4000          localhost:60110         
>>> VERBUNDEN   dspace     119840     6143/node
>>>
>>> I tried the suggestion from Michael. But this doesn't change anything as 
>>> the system still knows that localhost is 127.0.0.1 
>>> In the output of netstat nothing is changed. I even changed the value in 
>>> the apache config. Same. 
>>>
>>> ipv6 is disabled on the system.
>>> If I try
>>> wget -v "http://localhost:4000";
>>> I get:
>>> --2023-05-10 10:59:16--  http://localhost:4000/
>>> Auflösen des Hostnamens localhost (localhost) … 127.0.0.1, ::1
>>> Verbindungsaufbau zu localhost (localhost)|127.0.0.1|:4000 … verbunden.
>>> HTTP-Anforderung gesendet, auf Antwort wird gewartet … Lesefehler (Die 
>>> Wartezeit für die Verbindung ist abgelaufen) beim Vorspann (header).
>>> Erneuter Versuch.
>>>
>>> I tried enabling mod_headers and put 
>>>   RequestHeader set X-Forwarded-Proto https
>>> in the default-ssl.conf of my apache. No change of behavior.
>>>
>>> So I am completely stuck.
>>> Kind Regards
>>> Christiane
>>>
>>> DSpace Technical Support schrieb am Mittwoch, 10. Mai 2023 um 20:33:06 
>>> UTC+2:
>>>
>>> Hi Cristiane,
>>>
>>> In order to help, we'd need you to look for the underlying error message 
>>> when you attempt to access the User Interface (or backend, depending on the 
>>> problem).  Here's a troubleshooting guide with details on finding the 
>>> underlying error: 
>>> https://wiki.lyrasis.org/display/DSPACE/Troubleshoot+an+error#Troubleshootanerror-DSpace7.x(orabove)
>>>
>>> We also have a list of common installation issues at the bottom of the 
>>> install instructions. It's very likely you may be hitting one of these 
>>> common problems (but it'd be easier to tell which one after you look for 
>>> underlying errors): 
>>> https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-CommonInstallationIssues
>>>
>>> If you can find more information about the underlying error, it'll be 
>>> easier to help.
>>>
>>> You also could try initially running the User Interface manually (not in 
>>> PM2) just to verify your other configs are correct.  That would at least 
>>> help ensure you have a correct configuration between the frontend & 
>>> backend.  This is documented in step 6 of the Installation for the UI.
>>>
>>> Tim
>>>
>>> On Wednesday, May 10, 2023 at 11:11:57 AM UTC-5 
>>> c...@leibniz-psychology.org wrote:
>>>
>>> Hi there,
>>>
>>> I installed dspace-7.5 angular frontend on a different server, than the 
>>> backend. It is a ubuntu 22.04 and I did it as outlined in the Installing 
>>> the frontend section in <
>>> https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-InstallingtheFrontend(UserInterface)
>>> >
>>> I set up a apache proxy like it says in the documentation. Backend 
>>> (server/api) ist reachable. 
>>> I set up the config.prod.yml by taking the config.example.yml and 
>>> changing the value for 
>>> host: api7.dspace.org to the name of the backend server. HAL-Browser 
>>> answers at https://backend-server-name/server. So this is not the 
>>> problem.
>>> I set up pm2 (like stated in the documentation) to get more logs, 
>>> started the application and gave https://angular-server-name-as 
>>> configured in local.cfg on Backend and apache config on 
>>> angular-server-name. DNS is working.
>>> In the browser I get an error after waiting for minutes "The proxy 
>>> server received an invalid response from an upstream server.
>>>
>>> The proxy server could not handle the request
>>>
>>> Reason: *Error reading from remote server"*
>>>
>>> and in the pm2 logs this error message shows up.
>>>
>>> 0|dspace-ui  | GET / - - ms - -
>>>
>>> 0|dspace-ui  | 1 rules skipped due to selector errors:
>>>
>>> 0|dspace-ui  |   .custom-file-input:lang(en)~.custom-file-label -> 
>>> unmatched pseudo-class :lang
>>>
>>> Can somebody tell me what is misconfigured? in config.prod.yml language 
>>> is set to:
>>> defaultLanguage: en
>>> That is the entry in the original config.example.yml and I didn't 
>>> changed it.
>>>
>>> Kind regards
>>> Christiane
>>>
>>>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/a887b33e-f50c-408b-bcea-6c46fd5b6943n%40googlegroups.com.

Reply via email to