core-geonetwork
core-geonetwork copied to clipboard
Loading of avatar/Gravatar icon inconsistent
Describe the bug
Loading of the user's avatar/Gravatar icon is inconsistent between different states of the web UI. This can lead to errors in certain deployment environments.
To Reproduce
- Log in to GeoNetwork.
- After login, the user's avatar icon is retrieved from some local path, for example from
http://localhost/geonetwork/srv/api/users/116.png
. In my case this is a dummy silhouette icon (looks like this). This icon is used whenever working in sections "Search" or "Map". - After switching to "Contribute" or to "Admin console", the avatar icon is fetched from gravatar.com and represents either your personal picture or the Gravatar default icon.
- Switching back to "Search" or "Map" reverts back to the initial icon retrieval.
Expected behavior
Fetching of avatar/Gravatar is consistent throughout all states of the web UI.
Screenshots
Wrong avatar icon when using "Search" or "Map".
Correct avatar icon when using "Contribute" or "Admin console".
Log file
On my local development machine this issue does not cause any errors because the locally requested icon 116.png
is somehow successfully accessed from http://localhost/geonetwork/srv/api/users/116.png
.
But in my productive server environment, behind proxies and being accessed via HTTPS, this frequently causes HTTP 500
responses because the (local ?) icon fetching in sections "Search" or "Map" fails.
GeoNetwork log:
2021-06-24 14:21:28,905 ERROR [jeeves] - Error occurred within a transaction
javax.imageio.IIOException: Can't get input stream from URL!
...
Apache log:
xxx.xxx.xxx.xxx - - [24/Jun/2021:14:21:28 +0200] "GET /geonetwork/srv/api/users/116.png?size=56 HTTP/1.1" 500 27355 "https://my.domain.com/geonetwork/srv/ger/catalog.search" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
Desktop
- Browser: Firefox 78.11.0esr, Edge 91.0.864.71
- GeoNetwork Version: 3.12.1.0
- Server Application: Tomcat 9 with AdoptOpenJDK 8
Additional context
Might be related to #4582.
Still present in version 3.12.5.0.