Partial connection only with IWMS Behind Reverse Proxy

Started by Bones, February 10, 2023, 11:43:52 AM

Previous topic - Next topic

Bones

I am getting a 'Connecting to server ...'. The /Info page opens

I have IAM & IMWS running on a Windows 11 PC (called IAM).
I used the the Reverse Proxy in a SYnology NAS (DSM7)
The domain with a CNAME record points Pics.netamail.com.au to HomeNas49.synology.me - with a wild carded  certificate
I have modified the C:\ProgramData\photools.com\IMatchAnywhere\IMWS\docroot\imatchviewer\imatch\config\ config.json
- was            "imwsUrl": "http://IAM:8081/",
- changed to      "imwsUrl": "http://pics.netamail.com.au:8081/",
- also tried      "imwsUrl": "http://192.168.1.182:8081/",   

i have read all the posts on VPN & Reverse proxy i could find in the forum and it feels close

suspect i have missed some aspect - any thoughts?

Mario

It is not clear from your description which problem you have.

With /info, do you mean you called the http://..../info endpoint in your web browser?
With the domain name or the IP address?
Does this go through the reverse proxy you have set up?
If the /info endpoint is accessible, IMWS is running and accepts connections. So far so good.

Is IMatch WebViewer is not working (?).
If so, it does not know how to reach your server. Which would indicate that the imwsUrl parameter in the Web Viewer config file is not correct.

Tip: In your web browser, press the <F12> to open the integrated developer tools.
Switch to the Network tab (or similar, depends on your browser).
Click into the IMatch Anywhere WebViewer again and press <Ctrl>+<F5> to reload it.
The Network tab will show WebViewer loading scripts and style sheets and tying to connect to IMWS.
If you see lines indicate in read or with the prefix "Error" or similar, this indicates the source of the problem. When IMatch Anywhere WebViewer is trying to connect to IMWS but cannot, this will show as an error in the Network tab and you will also see error messages in the Console tab.

This may help to figure this out.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Bones

THanks - sorry on the delay - i had preferences wrong in this forum and did not get an email - missed your response
I would have liked to attached some screen shots - cant seem to work out how to achieve embedding or attaching one from my PC...

If i go direct to the IP address (ie Local) all seems fine - the /Info page & the imatchviewer page comes up.
The problem i get is - when using the Reverse Proxy - that it stays in a "Connecting to server 'http://192.168.1.182:8081/'; ..." state for ever. This is the response when i use the URL of . https://pics.netamail.com.au/imatchviewer/

QuoteIf the /info endpoint is accessible, IMWS is running and accepts connections. So far so good
- i beleive it is - if i enter https://pics.netamail.com.au/info - i get a correct response i beleive - ie
{"appName":"IMatch Webservices","edition":"TRIAL","version":"2019.29.3","apiVersion":"v1","platform":"64-bit","debugLevel":0,"requiresAuth":false,"defaultUser":"IMWS_DEFAULT_USER","machineName":"IAM","hostApplication":{"name":"IMWS","version":"19.29.3"},"documentRoot":"C:\\ProgramData\\photools.com\\IMatchAnywhere\\IMWS\\docroot","tempFolder":"C:\\Users\\TONY~1.WAT\\AppData\\Local\\Temp\\","logFileName":"C:\\Users\\TONY~1.WAT\\AppData\\Local\\Temp\\IMATCH_WEBSERVICE_LOG.TXT","logFileWarnings":1,"logFileErrors":0,"debugBuild":false,"readOnly":false,"telemetryEnabled":false,"calDaysRemaining":17,"calIsTrialCal":true,"idLists":0,"idListsSize":0,"cacheSizes":{"T":300,"N4":400,"SMALL":400,"N8":800,"N12":1200,"N16":1600,"NHD":1920,"QHD":2560,"4K":3840,"LARGE":3840,"MEDIUM":3840},"database":{"fileName":"IMatch Database","uniqueId":"96D6F59C-0140-47EE-92CA-B98623780C42","readOnly":false,"langId":"","uiLangId":"en","files":70,"folders":4,"categories":105,"historyEntries":184,"totalFileSize":492777673,"dbSize":22847488,"events":0,"faces":3,"persons":3,"sortprofiles":{"list":["Added","Capture Time","Capture Time (Newest first)","Checksum","Custom","Default","Events","File Format","Flag","Label","Orientation","Persons","Rating","Similar Faces","Similar Images","Similarity","Stack","Version"],"default":"Default","custom":"Custom"},"diagnosis":{"lastRun":"2023-02-06T14:22:26","runtime":0,"warnings":0,"errors":0},"compact":{"lastRun":"","runtime":0,"fileCount":0},"cache":{"folder":"C:\\ProgramData\\photools.com\\IMatch6\\previewcache\\96D6F59C-0140-47EE-92CA-B98623780C42\\","tempFolder":"C:\\ProgramData\\photools.com\\IMatch6\\previewcache\\96D6F59C-0140-47EE-92CA-B98623780C42\\temp\\Tony.Watkins\\","filesPerm":0,"sizePerm":0},"exifToolVersion":"12.49","sqliteVersion":3039000},"updateInfo":{"currentVersion":"2017.18.2","releaseDate":"2018-07-22T12:00:22","name":"IMatch Anywhere HOME","description":"Please see the release notes at https://www.photools.com/release-notes for detailed information about the changes and additions in this version.","installedVersion":"2019.29.3","updateAvailable":false},"options":{"backgroundImportEnabled":true,"backgroundWriteBackEnabled":true,"setPendingWhenFileSystemDateUsed":true,"faceLabelProperty":""},"requestInfo":{"host":"pics.netamail.com.au"}}
QuoteIs IMatch WebViewer is not working (?).
If so, it does not know how to reach your server. Which would indicate that the imwsUrl parameter in the Web Viewer config file is not correct.
This is what it looks like - prefer to use machine name - but fixed IP at the moment...
the config.json =
{
  "imwsUrl": "http://192.168.1.182:8081/",
 
  "debugMode" : false,

  "defaultLanguage": "en_US",
  "defaultLocale" : "en_US",

  "showNavStored": true,
  "showNavLikes": true,
  "showNavColBar": true,
  "showNavFilter": true,
  "showNavSearch" :  true,
  "showNavFolders": true,
  "showNavCategories": true,
  "showNavCollections": true,
  "showNavTimeline": true,
 
  "allowSaveSettings": true,

  "allowDownloads" : true,
  "allowOriginalDownload": true,
  "maxDownloads" : 20,
  "allowCustomDownloadPresets" : true,

  "BingMapsKey": "",

  "GoogleMapsKey" : "",

  "enableFileLens" : true,

  "helpUrl":  "help/index.html"
}

QuoteTip: In your web browser, press the <F12> to open the integrated developer tools.
Switch to the Network tab (or similar, depends on your browser).
Click into the IMatch Anywhere WebViewer again and press <Ctrl>+<F5> to reload it.
The Network tab will show WebViewer loading scripts and style sheets and tying to connect to IMWS.
If you see lines indicate in read or with the prefix "Error" or similar, this indicates the source of the problem. When IMatch Anywhere WebViewer is trying to connect to IMWS but cannot, this will show as an error in the Network tab and you will also see error messages in the Console tab.

I got this from a CTRL-F5 -
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular/angular.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular-resource/angular-resource.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular-cookies/angular-cookies.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular-touch/angular-touch.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular-animate/angular-animate.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular-route/angular-route.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/node_modules/angular-sanitize/angular-sanitize.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/angular-dynamic-locale/dist/tmhDynamicLocale.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://pics.netamail.com.au/imatchviewer/bower_components/vis/dist/vis.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
favicon-32x32.png:1          Failed to load resource: the server responded with a status of 404 ()
angular.min.js:109 Mixed Content: The page at 'https://pics.netamail.com.au/imatchviewer/#!/init' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://192.168.1.182:8081/info'. This request has been blocked; the content must be served over HTTPS.
(anonymous) @ angular.min.js:109
q @ angular.min.js:104
(anonymous) @ angular.min.js:102
(anonymous) @ angular.min.js:136
$digest @ angular.min.js:147
$apply @ angular.min.js:151
l @ angular.min.js:103
s @ angular.min.js:108
y.onload @ angular.min.js:109
load (async)
(anonymous) @ angular.min.js:108
q @ angular.min.js:104
(anonymous) @ angular.min.js:102
(anonymous) @ angular.min.js:136
$digest @ angular.min.js:147
$apply @ angular.min.js:151
(anonymous) @ angular.min.js:22
invoke @ angular.min.js:44
c @ angular.min.js:22
Uc @ angular.min.js:22
(anonymous) @ application.min.2019.29.4.js:2
(anonymous) @ angular.min.js:136
$digest @ angular.min.js:147
$apply @ angular.min.js:151
l @ angular.min.js:103
s @ angular.min.js:108
y.onload @ angular.min.js:109
load (async)
(anonymous) @ angular.min.js:108
q @ angular.min.js:104
(anonymous) @ angular.min.js:102
(anonymous) @ angular.min.js:136
$digest @ angular.min.js:147
(anonymous) @ angular.min.js:150
e @ angular.min.js:48
(anonymous) @ angular.min.js:51
setTimeout (async)
h.defer @ angular.min.js:51
$evalAsync @ angular.min.js:150
(anonymous) @ angular.min.js:134
k @ angular.min.js:136
then @ angular.min.js:139
n @ angular.min.js:101
n.<computed> @ angular.min.js:106
(anonymous) @ application.min.2019.29.4.js:2
j @ jquery.min.js:2
k @ jquery.min.js:2
setTimeout (async)
(anonymous) @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
fire @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
S @ jquery.min.js:3
favicon-16x16.png:1          Failed to load resource: the server responded with a status of 404 ()

Mario

I think this is your hint:

The page at
'https://pics.netamail.com.au/imatchviewer/#!/init' was loaded over
HTTPS, but requested an insecure XMLHttpRequest endpoint
'http://192.168.1.182:8081/info'. This request has been blocked; the
content must be served over HTTPS.

Seems like a problem with your reverse proxy configuration and HTTPS (TLS).
If you use a reverse proxy, IMatch WebViewer (WV) needs the address of the proxy. The proxy receives the request from WV, forwards them to IMWS and then forwards the response from IMWS back to WV.

You open WebViewer from https://pics.netamail.com.au/imatchviewer/ via HTTPS, but IMatch WebViewer then makes requests to http://192.168.1.182:8081/info which does not seem right? The IMWSConfig URL should point at your proxy, not at the IP of IMWS behind the proxy. All requests must be made against your proxy.


-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Bones

Thanks for the Hints - also found this comment in another post that helped
QuoteThis option tells the WebBrowser how to connect to IMWS. See the IMatch Anywhere Admin documentation for details about this and all other options in the configuration file.
I eventually ended up with "imwsUrl": set to =    "https://pics.netamail.com.au/"
So issue was the imwsURL should be the text used in the consuming browser (in my case - the external URL)

Now i get connection and can view, edit, slideshow images in the library - so it works - thanks heaps.

I do get 9 warnings & 10 errors on page launch - with a long delay after the 3rd error
2023-02-21 14_23_34-IMatch WebViewer™.jpg
Are these of concern/need resolving?

Mario

QuoteI eventually ended up with "imwsUrl": set to =    "https://pics.netamail.com.au/"

The address of the web server (or reverse proxy in your case).
The errors are OK and can be ignored.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook