nodebb running, but inaccessible from browser (local install)

  • NodeBB

    @Giorgio-Chiodi do you have access to redis-cli to run some commands?


  • @baris sorry, I haven't seen your post. Yes, I have access

  • NodeBB

    Can you the run the following command.

    redis-cli
    zrange categories:cid 0 -1
    

  • zrange categories:cid 0 -1

    @baris operation not permitted should i go sudo?

  • GNU/Linux Admin

    @giorgio-chiodi Does your redis have a password? If so, you'll need to type this command first:

    AUTH {password}


  • @julian ok now what 🙂

    redis 127.0.0.1:6379> zrange categories:cid 0 -1
     1) "1"
     2) "14"
     3) "29"
     4) "13"
     5) "2"
     6) "30"
     7) "15"
     8) "3"
     9) "31"
    10) "16"
    11) "20"
    12) "33"
    13) "4"
    14) "17"
    15) "18"
    16) "19"
    17) "34"
    18) "5"
    19) "22"
    20) "32"
    21) "6"
    22) "23"
    23) "7"
    24) "24"
    25) "8"
    26) "25"
    27) "9"
    28) "10"
    29) "26"
    30) "11"
    31) "27"
    32) "12"
    33) "28"
    34) "21"
    redis 127.0.0.1:6379> 
    
    
  • NodeBB

    Can you change this line https://github.com/designcreateplay/NodeBB/blob/master/src/categories.js#L290 to

    console.log(cid);
    throw new Error('category not found');
    

    And let us know the output.


  • console.log(cid);

    @baris

    (error) ERR unknown command 'console.log(cid);'

  • GNU/Linux Admin

    @giorgio-chiodi Please add those two lines into the code 🙂

    Follow this link, find that line, and replace it with the code in @baris' post.


  • @julian ahhh whoops sorry thought it was a command


  • @julian ok I've edited the file - now what?


  • @baris what output?

  • NodeBB

    Try running again to get that Error: No category found! error and see what the output is.


  • @baris

    info: NodeBB Ready
    17
    error: [app] Encountered Uncaught Exception: category not found
    Error: category not found
        at /home/super/nodeBB/nodebb/src/categories.js:291:12
        at /home/super/nodeBB/nodebb/src/database/redis.js:154:4
        at try_callback (/home/super/nodeBB/nodebb/node_modules/redis/index.js:532:9)
        at RedisClient.return_reply (/home/super/nodeBB/nodebb/node_modules/redis/index.js:614:13)
        at HiredisReplyParser.<anonymous> (/home/super/nodeBB/nodebb/node_modules/redis/index.js:266:14)
        at HiredisReplyParser.EventEmitter.emit (events.js:95:17)
        at HiredisReplyParser.execute (/home/super/nodeBB/nodebb/node_modules/redis/lib/parser/hiredis.js:43:18)
        at RedisClient.on_data (/home/super/nodeBB/nodebb/node_modules/redis/index.js:488:27)
        at Socket.<anonymous> (/home/super/nodeBB/nodebb/node_modules/redis/index.js:82:14)
        at Socket.EventEmitter.emit (events.js:95:17)
    info: [app] Restarting...
    info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    info: [app] Database connection closed.
    info: [app] Shutdown complete.
    info: NodeBB v0.3.2 Copyright (C) 2013 DesignCreatePlay Inc.
    info: This program comes with ABSOLUTELY NO WARRANTY.
    info: This is free software, and you are welcome to redistribute it under certain conditions.
    info: 
    info: Time: Thu Mar 06 2014 19:10:32 GMT+0100 (CET)
    info: Initializing NodeBB v0.3.2
    info: * using configuration stored in: /home/super/nodeBB/nodebb/config.json
    info: * using redis store at 127.0.0.1:6379
    info: * using themes stored in: /home/super/nodeBB/nodebb/node_modules
    info: Base Configuration OK.
    info: [themes] Using theme nodebb-theme-lavender
    info: Static directory routed for theme: nodebb-theme-lavender
    info: Custom templates directory routed for theme: nodebb-theme-lavender
    info: Middlewares loaded.
    info: [plugins] Initializing plugins system
    info: [notifications.init] Registering jobs.
    warn: [plugins] Plugin 'nodebb-plugin-gallery' not found
    warn: [plugins] Plugin 'nodebb-plugin-youtube' not found
    warn: [plugins] Plugin 'nodebb-plugin-emailer-mailgun' not found
    warn: [plugins] Plugin 'nodebb-plugin-desktop-notifications' not found
    warn: [plugins] Plugin 'nodebb-plugin-imgbed' not found
    warn: [plugins/nodebb-widget-essentials] staticDir is deprecated, use staticDirs instead
    info: [plugins] Found 1 CSS file(s) for plugin nodebb-widget-essentials
    warn: [plugins/nodebb-widget-essentials] staticDir is deprecated, define CSS files with new staticDirs instead.
    warn: [plugins/nodebb-plugin-mentions] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    info: [plugins] Found 1 LESS file(s) for plugin nodebb-plugin-mentions
    info: [plugins] Found 2 js file(s) for plugin nodebb-plugin-mentions
    warn: [plugins/nodebb-plugin-markdown] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    info: [plugins] Found 1 LESS file(s) for plugin nodebb-plugin-markdown
    warn: [plugins/nodebb-theme-lavender] staticDir is deprecated, use staticDirs instead
    info: [plugins] Loaded plugin: nodebb-widget-essentials
    info: [plugins] Loaded plugin: nodebb-plugin-mentions
    info: [plugins] Loaded plugin: nodebb-plugin-markdown
    info: [plugins] Loaded plugin: nodebb-theme-lavender
    info: [plugins] Sorting hooks to fire in priority sequence
    info: [plugins] Plugins OK
    info: NodeBB attempting to listen on: 0.0.0.0:4567
    info: NodeBB Ready
    ^Cinfo: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    info: [app] Database connection closed.
    info: [app] Shutdown complete.
    
  • NodeBB

    Ok looks like category 17 is the problem now run the following in redis-cli to see if its in the database.

    hgetall category:17
    

  • @baris (empty list or set)

  • NodeBB

    Looks like the category was somehow deleted. What about the other ones? Does hgetall category:18 return anything?


  • @baris yes, that one works

     1) "cid"
     2) "18"
     3) "name"
     4) "giglio"
     5) "description"
     6) "CSC"
     7) "icon"
     8) ""
     9) "bgColor"
    10) "#0059b2"
    11) "color"
    12) "#fff"
    13) "slug"
    14) "18/giglio"
    15) "topic_count"
    16) "0"
    17) "disabled"
    18) "1"
    19) "order"
    20) "5"
    21) "link"
    22) ""
    23) "numRecentReplies"
    24) "2"
    25) "class"
    26) "col-md-3 col-xs-6"
    27) "imageClass"
    28) "default"
    
  • NodeBB

    Alright, you can run the following commands to recreate category:17 and then edit in the control panel again.

    hset category:17 cid 17
    hset category:17 name editme
    hset category:17 description editme
    hset category:17 icon ""
    hset category:17 bgColor "#0059b2"
    hset category:17 color "#fff"
    hset category:17 slug "17/editme"
    hset category:17 topic_count 0
    hset category:17 disabled 1
    hset category:17 order 5
    hset category:17 link ""
    hset category:17 numRecentReplies 2
    hset category:17 class "col-md-3 col-xs-6"
    hset category:17 imageClass "default"
    

    Did you by any chance delete that category from the database? With a del command?


  • @baris well if it was deleted it wasn't me. maybe someone deleted it from the admin page.

Suggested Topics

  • 6
  • 20
  • 8
  • 3
  • 1
| |