GrandyB / SheetsIO

Small configurable Java app that pulls data from a Google Spreadsheet (using v4 api) and writes to files and a local webserver.
GNU Lesser General Public License v3.0
20 stars 3 forks source link

Cant seem to figure out whats going on #57

Open Icefireide opened 1 month ago

Icefireide commented 1 month ago

Describe the bug I am the only one to experience this issue with everyone who uses this sheet. Cannot figure out why.

Expected behavior I keep receiving errors and I dont know why, it should be loading fine as I downloaded it from someone whose entire setup works

app-2024-08-15.log

Desktop (please complete the following information): Most up to date windows 11 as of 8-15-24

GrandyB commented 1 month ago

It would be handy to know what exactly is or isn't happening, whether it's showing you errors or just not working - but a sequence of events would be useful.

That aside, and only basing off what I see in your log, I can see a few different exceptions going on here.

The one that seems most probable is an exception as it tries to pull down the image from a URL but retrieves HTML in the form of a Google 403 permission denied error page - the specific link being https://lh3.googleusercontent.com/drive-viewer/AKGpihaazVKXMVD05QfO5ynJY6TEP3Ik5gT1x1fHilq7cc7ZaL8bXZmRiPucsO9r42IMwXbbdH7kLZUAPSizj-Wv0VtHFMMgTn3bQ6M=s2560

Full error:

2024-31-15 14:31:03.635 [Thread-3] ERROR application.services.FileUpdater - URL was unable to be loaded: 'https://lh3.googleusercontent.com/drive-viewer/AKGpihaazVKXMVD05QfO5ynJY6TEP3Ik5gT1x1fHilq7cc7ZaL8bXZmRiPucsO9r42IMwXbbdH7kLZUAPSizj-Wv0VtHFMMgTn3bQ6M=s2560'
Outputting a transparent image
application.exceptions.UnableToLoadRemoteURLException: <!DOCTYPE html><html lang=en><meta charset=utf-8><meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"><title>Error 403 (Forbidden)!!1</title><style>*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><a href=//www.google.com/><span id=logo aria-label=Google></span></a><p><b>403.</b> <ins>That’s an error.</ins><p>Your client does not have permission to get URL <code>/drive-viewer/AKGpihaazVKXMVD05QfO5ynJY6TEP3Ik5gT1x1fHilq7cc7ZaL8bXZmRiPucsO9r42IMwXbbdH7kLZUAPSizj-Wv0VtHFMMgTn3bQ6M=s2560</code> from this server.  (Client IP address: 47.148.195.168)<br><br>Forbidden                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          <ins>That’s all we know.</ins>
    at application.services.FileIO.getInputStreamForRemoteUrl(FileIO.java:193) ~[rsrc:./:?]
    at application.services.FileIO.downloadAndConvertImage(FileIO.java:97) ~[rsrc:./:?]
    at application.services.FileUpdater.updateImage(FileUpdater.java:121) [rsrc:./:?]
    at application.services.FileUpdater.updateFile(FileUpdater.java:108) [rsrc:./:?]
    at application.services.FileUpdater.updateFiles(FileUpdater.java:89) [rsrc:./:?]
    at application.services.UpdateController.update(UpdateController.java:100) [rsrc:./:?]
    at application.threads.UpdateRunnable.perform(UpdateRunnable.java:54) [rsrc:./:?]
    at application.threads.IntervalRunnable.run(IntervalRunnable.java:47) [rsrc:./:?]
    at java.lang.Thread.run(Thread.java:842) [?:?]

I get the same error when trying to go to that file on my own browser, so maybe it uses your friend's browser session and can access the file on his machine, while you don't have access to that file via Google? I generally upload to imgur for partly this reason.

I can also see a reference in this log about pulling a remote image from a Discord image URL, where the content no longer exists. Not all too long ago Discord purged/moved a ton of images, which broke links to them, which may have caused this. Either way I'd definitely advise re-uploading such images to a site such as imgur instead. Here's the error related to that:

2024-14-15 14:14:44.931 [Thread-5] ERROR application.services.FileUpdater - URL was unable to be loaded: 'https://cdn.discordapp.com/attachments/1132050074357223445/1267539187842682991/Colts.png?ex=66a9275c&is=66a7d5dc&hm=ad400f357bb0c3a1089c07a09fb99c3fe451349e8a6a24372a739273ebad76a7&'
Outputting a transparent image
application.exceptions.UnableToLoadRemoteURLException: This content is no longer available.
    at application.services.FileIO.getInputStreamForRemoteUrl(FileIO.java:193) ~[temp0.jar:?]
    at application.services.FileIO.downloadAndConvertImage(FileIO.java:97) ~[temp0.jar:?]
    at application.services.FileUpdater.updateImage(FileUpdater.java:121) [temp0.jar:?]
    at application.services.FileUpdater.updateFile(FileUpdater.java:108) [temp0.jar:?]
    at application.services.FileUpdater.updateFiles(FileUpdater.java:89) [temp0.jar:?]
    at application.services.UpdateController.update(UpdateController.java:100) [temp0.jar:?]
    at application.threads.UpdateRunnable.perform(UpdateRunnable.java:54) [temp0.jar:?]
    at application.threads.IntervalRunnable.run(IntervalRunnable.java:47) [temp0.jar:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_391]

Let me know if moving files/setting correct google permissions etc works out for you.