Blank web page problems

I've had my KiwiSDR about a month.  It's been up and running - after installation and 10 minutes of playing around, it's been sitting idle in the background.  Today I went and tried to pull it up again.  The browser tries to load the page, but it sits for a while and eventually stops with a blank page.  The title shows up in the tab.  In Firefox, it reports "connection reset"; in Chrome there is no error.

kiwid is running.  I've tried restarting it, restarting the Beagle, and then pulled power on the beagle.  If I `curl kiwisdr.local:8073` I get HTML, so the base page load is working... seems like maybe it's a script thing?  Since the kiwid is one monolithic program, I'm not sure where to go from here to isolate the problem.  (In a standard webapp, I could go to the web server logs, then the app server logs (if available.))  Running strace shows a lot of sleeps and time management stuff, and I can see web requests/responses.

Here is the kiwi status:
<pre>
root@kiwisdr:~/Beagle_SDR_GPS# ms
systemctl --full --lines=100 status kiwid.service
? kiwid.service - kiwi daemon
   Loaded: loaded (/etc/systemd/system/kiwid.service; enabled)
   Active: active (running) since Sun 2016-11-13 17:53:34 UTC; 1min 50s ago
  Process: 620 ExecStop=/etc/init.d/kiwid stop (code=killed, signal=TERM)
  Process: 651 ExecStart=/etc/init.d/kiwid start (code=exited, status=0/SUCCESS)
 Main PID: 657 (kiwid)
   CGroup: /system.slice/kiwid.service
           ??657 /usr/local/bin/kiwid -use_spidev 1 -bg

Nov 13 17:53:34 kiwisdr kiwid[651]: DEBIAN 8
Nov 13 17:53:34 kiwisdr kiwid[651]: USE_SPIDEV
Nov 13 17:53:34 kiwisdr kiwid[651]: LOAD_SPI = no
Nov 13 17:53:34 kiwisdr kiwid[651]: Starting kiwid
Nov 13 17:53:34 kiwisdr kiwid[651]: Start kiwid: OK
Nov 13 17:53:34 kiwisdr kiwid[651]: Sun Nov 13 17:53:34 UTC 2016
Nov 13 17:53:34 kiwisdr kiwid[657]: 0:00:00 ....      KiwiSDR v1.22 --------------------------------------------------------------------
Nov 13 17:53:34 kiwisdr kiwid[657]: 0:00:00 ....      compiled: Nov  9 2016 02:31:44
Nov 13 17:53:34 kiwisdr kiwid[657]: 0:00:00 ....      reading configuration from file /root/kiwi.config/kiwi.json
Nov 13 17:53:35 kiwisdr kiwid[657]: 0:00:01 ....      serial number from EEPROM: 1231
Nov 13 17:53:35 kiwisdr kiwid[657]: 0:00:01 ....      reading configuration from file /root/kiwi.config/dx.json
Nov 13 17:53:35 kiwisdr kiwid[657]: 0:00:01 ....      883 dx entries
Nov 13 17:53:35 kiwisdr kiwid[657]: 0:00:01 ....      listening on port 8073 for "openwebrx"
Nov 13 17:53:35 kiwisdr kiwid[657]: 0:00:01 ....      webserver for "openwebrx" on port [::]:8073
Nov 13 17:53:35 kiwisdr kiwid[657]: 0:00:01 ....      ### using SPI_DEV
Nov 13 17:53:36 kiwisdr kiwid[657]: 0:00:02 ....      FPGA version 1
Nov 13 17:53:36 kiwisdr kiwid[657]: 0:00:02 ....      CFG read /root/kiwi.config/kiwi.json: sdr_hu_register = false
Nov 13 17:53:39 kiwisdr kiwid[657]: 0:00:05 ....      (0 users)
Nov 13 17:53:39 kiwisdr kiwid[657]: 0:00:05 ....      UPDATE: scheduled
Nov 13 17:53:39 kiwisdr kiwid[657]: 0:00:05 ....      UPDATE: checking for updates
Nov 13 17:53:40 kiwisdr kiwid[657]: 0:00:06 ....      UPDATE: version 1.22 is current
Nov 13 17:53:41 kiwisdr kiwid[657]: 0:00:07 ....      DDNS: private IPv4 <192.168.42.112> 0xc0a82a70 /24 0xffffff00
Nov 13 17:53:41 kiwisdr kiwid[657]: 0:00:07 ....      DDNS: public ip #MASKED#
</pre>

Thoughts?

Comments

  • What does the javascript console of the browser say? (i.e. option/alt-command-k in Firefox) The built-in web server (mongoose), which is just a monolithic chunk of C code, doesn't keep a traditional web server log file.
    rixon
  • The other thing you can do to get more printf output from the kiwi server program is to run it from the shell instead of as the usual daemon process. Do a "cdp" to get to the build directory. "mst" to stop the daemon. Then "k" to run directly. Not all the kiwi program printfs go to the syslog file to keep the log size under control.

    After you're done and control-C to stop the "k" program. Use "msa" to restart the daemon (or "ku" -- kiwi up).

    rixon
  • Cool, I'll go read up on mongoose.

    On the root page:
    openwebrx.js:3 Uncaught SyntaxError: Unexpected number
    ima_adpcm.js:3 Uncaught SyntaxError: Unexpected number
    kiwi_util.js:3 Uncaught SyntaxError: Unexpected number
    kiwi.js:3 Uncaught SyntaxError: Unexpected number
    ext.js:37 Uncaught ReferenceError: zoom is not defined(…)(anonymous function) @ ext.js:37

    On the /admin page (same symptoms from a user perspective):
    admin:31 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://kiwisdr.local:8073/extensions/loran_c/loran_c.css".
    admin:15 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://kiwisdr.local:8073/pkgs/font-awesome-4.6.3/css/font-awesome.min.css".
    admin:14 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://kiwisdr.local:8073/kiwi/kiwi.css".
    admin:13 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://kiwisdr.local:8073/kiwi/w3_ext.css".
    openwebrx.js:3 Uncaught SyntaxError: Unexpected number
    kiwi_util.js:3 Uncaught SyntaxError: Unexpected number
    ext.js:37 Uncaught ReferenceError: zoom is not defined(…)(anonymous function) @ ext.js:37
  • jksjks
    edited November 2016
    This looks like the files in the in-program/in-memory cache have become corrupted somehow. Try building and installing the daemon from scratch:
    cdp
    more Makefile -- the first two lines: what version number does it say you're running?
    msa
    mc
    m
    mi
    ku

    rixon
  • VERSION_MAJ = 1
    VERSION_MIN = 22

    * Logs show auto-updates have been working great - started with 1.12, and many unattended updates later am here on 1.22.  Nice work!

    I followed your make clean and reinstall steps in the last message.  Hmm, now I have some new js errors:
    ima_adpcm.js:3 Uncaught SyntaxError: Unexpected number
    (index):59 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://kiwisdr.local:8073/extensions/wspr/wspr.css".
    audio.js:3 Uncaught SyntaxError: Unexpected number
    kiwi_util.js:185 littleEndian=true
    kiwi.js:3 Uncaught SyntaxError: Unexpected number
    kiwi_util.js:10 Uncaught ReferenceError: kiwi_bodyonload is not defined(…)document.onreadystatechange @ kiwi_util.js:10

    Here are the errors from the admin page:
    admin:33 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://kiwisdr.local:8073/extensions/s4285/s4285.css".
    kiwi_util.js:3 Uncaught SyntaxError: Unexpected number
    w3_util.js:3 Uncaught SyntaxError: Unexpected number

    So, I clicked on some of these files.  I see the ones with the "Unexpected number" start like this (example - config.js):

    0

    HTTP/1.1 200 OK
    Content-Type: application/x-javascript
    Access-Control-Allow-Origin: *
    Transfer-Encoding: chunked

    1D3D
    // Default settings for a new connection
    // are in "config" tab of admin interface.

    var init_frequency;

    and the "200" is highlighted.  Should the first 8 lines be stripped from there, so only the actual javascript is saved?

    I'm also noticing that on reloading the pages, I get different results each time... sometimes those first 8 lines are not in the .js files in developer tools, sometimes they're not and there aren't errors.  Each time I reload the files with syntax errors are different, but always the page load fails and is blank.

  • Something is dreadfully wrong here. Try pulling from git first:
    cdp
    mst
    m git
    mc
    m
    mi
    ku

    rixon
  • I feel really foolish, and apologize for wasting your time...

    I pulled and rebuilt, and it worked again... partially.  Part of the page loaded, but nothing withing the frames.  The /admin was still broken, more of the same stuff - a few syntax errors due to the HTTP headers being at the start of the files.  This was sounding more and more like a local issue.

    I disabled the active parts of Sophos Anti-Virus, which my company requires that we all run.  As soon as I disabled and reload the page, everything worked.  Both the user and admin pages work fine without Sophos getting in the way.  To disable, on MacOS, click Sophos on the toolbar, then Open Preferences..., Web Filtering tab, click the lock in the lower left to allow changes, then turn off "Block malicious downloads from websites... obfuscated, polymorphic and zero-day threats...".  The kiwisdr can be whitelisted by clicking on the whitelist tab - but you have to use the IP address; using the kiwisdr.local mDNS does not work.

    I rarely have web problems like this, so it's a little surprising this was the cause.  Maybe Sophos treats local network content a little differently? 
    Thank you so much for your quick replies and providing useful troubleshooting information.  I hope this helps someone else solve the same problem.
  • jksjks
    edited November 2016
    I should have though of this. We had a very similar problem before with over-agressive AdBlock filter rules (see https://github.com/jks-prv/Beagle_SDR_GPS/issues/36) I got around that by not using common keywords in the Kiwi status update XHRs.

    The things you discover when deploying on a large scale.. lol

Sign In or Register to comment.