jalibu / MMM-Jast

A minimalistic stock ticker based on Yahoo's finance API for the MagicMirror² platform.
MIT License
67 stars 22 forks source link

Invalid Cookie #57

Closed pgerken closed 1 year ago

pgerken commented 1 year ago

Platform

Raspberry Pi OS

Node.js Version

16.20.1

MagicMirror Version

2.24.0

Module Version

v2.8.2 0295f2c7e1bcf6c028c592303ecc68a1e5d114d9

Description

Module just shows "Loading"

Logs show the following:

0|mm | [17.07.2023 07:23.57.908] [WARN] API request for ^NYA failed: Invalid Cookie 0|mm | [17.07.2023 07:23.57.911] [WARN] API request for ^DJI failed: Invalid Cookie 0|mm | [17.07.2023 07:23.57.913] [WARN] API request for LMT failed: Invalid Cookie 0|mm | [17.07.2023 07:23.57.914] [WARN] API request for GOOG failed: Invalid Cookie 0|mm | [17.07.2023 07:23.57.915] [WARN] API request for AAPL failed: Invalid Cookie

Expected behavior

The ticker should show the latest stock prices.

Current behavior

Module just shows "Loading"

Possible solution

Fix cookie issue?

Steps to reproduce

  1. Start MM
  2. Wait for it to load
  3. See "Loading" where it should show stocks.

Log

0|mm       | [17.07.2023 07:23.57.908] [WARN]  API request for ^NYA failed: Invalid Cookie
0|mm       | [17.07.2023 07:23.57.911] [WARN]  API request for ^DJI failed: Invalid Cookie
0|mm       | [17.07.2023 07:23.57.913] [WARN]  API request for LMT failed: Invalid Cookie
0|mm       | [17.07.2023 07:23.57.914] [WARN]  API request for GOOG failed: Invalid Cookie
0|mm       | [17.07.2023 07:23.57.915] [WARN]  API request for AAPL failed: Invalid Cookie

config.js

pi@raspberrypi:~/install/mm2/backup $ cat config.js
/* MagicMirror² Config Sample
 *
 * By Michael Teeuw https://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information on how you can configure this file
 * see https://docs.magicmirror.builders/configuration/introduction.html
 * and https://docs.magicmirror.builders/modules/configuration.html
 *
 * You can use environment variables using a `config.js.template` file instead of `config.js`
 * which will be converted to `config.js` while starting. For more information
 * see https://docs.magicmirror.builders/configuration/introduction.html#enviromnent-variables
 */
let config = {
    address: "localhost",   // Address to listen on, can be:
                                // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
                                // - another specific IPv4/6 to listen on a specific interface
                                // - "0.0.0.0", "::" to listen on any interface
                                // Default, when address config is left out or empty, is "localhost"
    port: 8080,
    basePath: "/",      // The URL path where MagicMirror² is hosted. If you are using a Reverse proxy
                                // you must set the sub path here. basePath must end with a /
    ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],  // Set [] to allow all IP addresses
                                                                // or add a specific IPv4 of 192.168.1.5 :
                                                                // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
                                                                // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
                                                                // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

    useHttps: false,        // Support HTTPS or not, default "false" will use HTTP
    httpsPrivateKey: "",    // HTTPS private key path, only require when useHttps is true
    httpsCertificate: "",   // HTTPS Certificate path, only require when useHttps is true

    language: "en",
    locale: "en-US",
    logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
    timeFormat: 24,
    units: "imperial",

    modules: [
    {
        module: "alert",
    },
    {
        module: "updatenotification",
        position: "top_bar"
    },
    {
        module: "clock",
        position: "top_left"
    },
        {
            module: 'calendar_monthly',
            position: 'top_left',
            config: {
                // The config property is optional
                // Without a config, a default month view is shown                                                             
                // Please see the 'Configuration Options' section for more information                                         
            }
        },
    {
        module: "weather",
        position: "top_right",
        config: {
        weatherProvider: "openweathermap",
        type: "current",
        location: "New York",
        locationID: "4828862", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
        apiKey: "xxx"
        }
    },
    {
        module: 'MMM-AirQuality',
        position: 'top_center', // you may choose any location
        header: 'AQI', //choose a header if you like
        config: {
        location: 'usa/newjersey/camden-spruce-st' // the location to check the index for
        }
    },
    {
        module: "weather",
        position: "top_center",
        header: "Weather Forecast",
        config: {
        fade: false,
        weatherProvider: "openweathermap",
        weatherEndpoint: "/onecall",
        //type: "forecast",
        type: "hourly", // location and locationID are ignored, uses lat/lon instead.
        location: "New York",
        locationID: "4828862", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
        apiKey: "xxx",
        lat: xxx
        lon: xxx,
        maxEntries: 7
        }
    },
        {
            module: 'MMM-SystemStats',
            position: 'top_right', // This can be any of the regions.
            // classes: 'small dimmed', // Add your own styling. OPTIONAL.
            // header: 'System Stats', // Set the header text OPTIONAL
            config: {
                updateInterval: 10000, // every 10 seconds
                align: 'right', // align labels
                //header: 'System Stats', // This is optional
                units: 'metric', // default, metric, imperial
                view: 'textAndIcon',
            },
    },
    {
        module: "newsfeed",
        position: "bottom_bar",
        config: {
        feeds: [
            {
            title: "Associated Press - Technology",
            url: "https://rsshub.app/apnews/topics/technology"
            },
            {
            title: "Associated Press - Politics",
            url: "https://rsshub.app/apnews/topics/politics"
            },
            {
            title: "CNN - Top Stories",
            url: "http://rss.cnn.com/rss/cnn_topstories.rss"
            },
            {
            title: "CNN - World",
            url: "http://rss.cnn.com/rss/cnn_world.rss"
            },
            {
            title: "CNN - U.S.",
            url: "http://rss.cnn.com/rss/cnn_us.rss"
            },
            {
            title: "CNN - Business",
            url: "http://rss.cnn.com/rss/money_latest.rss"
            },
            {
            title: "CNN - Politics",
            url: "http://rss.cnn.com/rss/cnn_allpolitics.rss"
            },
            {
            title: "CNN - Technology",
            url: "http://rss.cnn.com/rss/cnn_tech.rss"
            },
            {
            title: "New York Times",
            url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"
            },
            {
            title: "Wall Street Journal - World News",
            url: "https://feeds.a.dj.com/rss/RSSWorldNews.xml"
            },
            {
            title: "Wall Street Journal - Business",
            url: "https://feeds.a.dj.com/rss/WSJcomUSBusiness.xml"
            },
            {
            title: "Wall Street Journal - Market News",
            url: "https://feeds.a.dj.com/rss/RSSMarketsMain.xml"
            },
            {
            title: "Wall Street Journal - Technology",
            url: "https://feeds.a.dj.com/rss/RSSWSJD.xml"
            },
            {
            title: "MacRumors",
                        url: "http://feeds.macrumors.com/MacRumors-All",
            }           
        ],
        showSourceTitle: true,
        showPublishDate: true,
        broadcastNewsFeeds: true,
        broadcastNewsUpdates: true
        }
    },
    {
        module: "MMM-Jast",
        position: "bottom_bar",
        config: {
        currencyStyle: "symbol", // One of ["code", "symbol", "name"]
        fadeSpeedInSeconds: 60,
        lastUpdateFormat: "HH:mm",
        maxChangeAge: 1 * 24 * 60 * 60 * 1000,
        maxWidth: "100%",
        numberDecimalsPercentages: 1,
        numberDecimalsValues: 2,
        scroll: "horizontal", // One of ["none", "vertical", "horizontal"]
        showColors: true,
        showCurrency: true,
        showChangePercent: true,
        showChangeValue: false,
        showChangeValueCurrency: false,
        showHiddenStocks: false,
        showLastUpdate: true,
        showPortfolioValue: false,
        showPortfolioGrowthPercent: false,
        showPortfolioGrowth: false,
        updateIntervalInSeconds: 10,
        useGrouping: false,
        virtualHorizontalMultiplier: 2,
        stocks: [
            { name: "NYSE", symbol: "^NYA" },
            { name: "DJ", symbol: "^DJI" },
            { name: "LM", symbol: "LMT" },
            { name: "Google", symbol: "GOOG" },
            { name: "Apple", symbol: "AAPL"}
        ]
        }
    },

    ]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

Additional info

I recently did a git pull on MMM-Jast because a notification stated a new version was available. However, the "Loading" issue was happening before the update. I was hoping the update would fix it, but it did not.

jalibu commented 1 year ago

@pgerken are you sure that you executed another npm install and did a MagicMirror restart after pulling the latest version?

pgerken commented 1 year ago

@jalibu ... I did not.. I just now ran "npm install --only=production" and restarted. It's working now! Thanks!