Modifying Port for debug

i have seen documentation for this topic but its not clear to implement can u please me out for modifying port

https://docs.couchbase.com/server/current/eventing/eventing-debugging-and-diagnosability.html#modifydebugport

Boby,

I will be updating the documentation to explain the process properly (yes the docs are lacking), generally if you alter the port you would want to do this before you set up your cluster as you will loss your data if you do this on a single node non MDS system. Below I show how to change the debugging port from 9140 to 9444

STEP 1. stop couchbase (linux debian command - your command may differ)

systemctl stop couchbase-server

STEP 2. alter the port as follows (I backup the key file and use an echo command)

cp /opt/couchbase/etc/couchbase/static_config /opt/couchbase/etc/couchbase/static_config.sav
echo "{eventing_debug_port, 9444}." >> /opt/couchbase/etc/couchbase/static_config

STEP 3. verify you have the correct last line via the tail command.

tail -1  /opt/couchbase/etc/couchbase/static_config
{eventing_debug_port, 9444}.

STEP 4. !!! WARNING (you will lose all your data - but this must be done to alter the port). !!!
# !!! WARNING the old data or buckets will be automatically removed when you setup the cluster again

rm /opt/couchbase/var/lib/couchbase/config/config.dat

# !!! you don’t want old log files so remove them since this is a fresh setup

rm /opt/couchbase/var/lib/couchbase/logs/*.*

STEP 5. start couchbase (linux debian command - your command may differ)

systemctl start couchbase-server

DONE at this point the debugging port will be 9444 for Eventing

1 Like

@jon.strabala
tq so much. it worked

@jon.strabala

hello,
modifying port is successfully done , now the issue is where to find source code
its saying in middle of workspace"drop in a folder to add workspace" i mean js code is not presented directly in debug page

Boby

What is your OS?

What web browser do you use? The debugger relies on the Google Chrome Debugger engine for running the Javascript code of your handler.

And please attach a screen shot showing your issue!

actually am using mac os.

in cloud (linux) its working , but cant find code in debugger

Please give both versions in the upper right corner of the two “dashboard@ views. But let’s focus on one issue and one OS at a time.

When your running in the cloud you do need to set up a port forward for the debugger

tq lets go for mac then.

  • mainly in mac , say the way to start /stop couchbase server in terminal (in documentation )

  • second issue am facing “{eventing_debug_port, 1944}” is saving in static_config but when starting server it takes default static_config (without any debugging port)

please help me out

Boby,

mainly in mac , say the way to start /stop couchbase server in terminal (in documentation )

Start Couchbase Server from the terminal on MacOS

cd /Applications/Couchbase\ Server.app
open -a Couchbase\ Server.app

Stop Couchbase Server from the terminal on MacOS

osascript -e 'quit app "Couchbase Server"'

second issue am facing “{eventing_debug_port, 1944}” is saving in static_config but when starting server it takes default static_config (without any debugging port)

Please read the updated documentation at Debugging and Diagnosability | Couchbase Docs

I believe you need the trailing period “.” in your static_config syntax.

@jon.strabala
(modified static_config and restarted server ) but add function is not workingScreenshot 2020-03-05 at 1.28.03 PM

displaying “Cannot connect. Eventing may be starting up. Please retry after some time.”

Boby

The static_config file must have zero errors. (Yes not ideal that you don’t get a warning if a bad config file)

Just uninstall Couchbase then reinstall and follow the documentation I previously linked exactly

Let me know how it goes

heelo @jon.strabala

#i stoped server using terminal
#went to static_config (with full permission)
#replaced with {debugPort,9050} (and tried with not replacing too)
#started server still not working (it will be default static_config only ,like same as before editing)
Screenshot 2020-03-06 at 12.00.36 PM

The line above for net_kernel_verbosity is missing a required period.

And remember you must delete the config.dat after any change.

Remember the MacOS and the Linux static_config files are different so I hope you didn’t copy the file between Differing operating systems

hello @jon.strabala tq tq… now i wll say step by step(what i did those steps) if any mistake just say

  1. stoped server >> osascript -e ‘quit app “Couchbase Server”’

2.head to static config :

{error_logger_mf_dir, “/Users/loonycorn/Library/Application Support/Couchbase/var/lib/couchbase/logs”}.
{path_config_bindir, “/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin”}.
{path_config_etcdir, “/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/etc/couchbase”}.
{path_config_libdir, “/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib”}.
{path_config_datadir, “/Users/loonycorn/Library/Application Support/Couchbase/var/lib/couchbase”}.
{path_config_tmpdir, “/Users/loonycorn/Library/Application Support/Couchbase/var/lib/couchbase/tmp”}.
{path_config_secdir, “/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/etc/security”}.

{nodefile, “/Users/loonycorn/Library/Application Support/Couchbase/var/lib/couchbase/couchbase-server.node”}.

{loglevel_default, debug}.
{loglevel_couchdb, info}.
{loglevel_ns_server, debug}.
{loglevel_error_logger, debug}.
{loglevel_user, debug}.
{loglevel_menelaus, debug}.
{loglevel_ns_doctor, debug}.
{loglevel_stats, debug}.
{loglevel_rebalance, debug}.
{loglevel_cluster, debug}.
{loglevel_views, debug}.
{loglevel_mapreduce_errors, debug}.
{loglevel_xdcr, debug}.
{loglevel_access, info}.
{loglevel_cbas, debug}.

{disk_sink_opts,
[{rotation, [{compress, true},
{size, 41943040},
{num_files, 10},
{buffer_size_max, 52428800}]}]}.

{disk_sink_opts_json_rpc,
[{rotation, [{compress, true},
{size, 41943040},
{num_files, 2},
{buffer_size_max, 52428800}]}]}.

{net_kernel_verbosity, 10}.
{debugPort, 9050}.

  1. added : {eventing_debug_port, 9444}.

  2. deleted config.dat (inside lib/couchbase/config/config.dat)

  3. restarted server (created new cluster)

but wen i check still 1940 port

using linux (cloud) i changed port (to 1944)but there is another issue no code displayed

Boby

I insist that you stick to one environment and one operating system at a time.

I answer your macOS question here:

  1. Let’s fully remove your macOS install (command line via a temrinal)

     osascript -e 'quit app "Couchbase Server"'
     sleep 4
     rm -rf /Applications/Couchbase\ Server.app
     rm -rf ~/Library/Application\ Support/Couchbase && rm -rf ~/Library/Application\ Support/membase && rm -rf ~/Library/Python/couchbase-py
    
  2. Now download the EE version’s *.dmg file to ~/Downloads in particular Couchbase Server 6.5.0 Enterprise for macOS from https://www.couchbase.com/downloads

     ls -ltr ~/Downloads/couchbase-server-enterprise_6.5.0-macos_x86_64.dmg
     # -rw-r--r--@ 1 jon.strabala  staff  532893023 Mar  6 09:52 /Users/jon.strabala/Downloads/couchbase-server-enterprise_6.5.0-macos_x86_64.dmg
    
  3. DO NOT INSTALL OR LAUNCH VIA THE COMMAND LINE YOU MIGHT GET WEIRD PERMISSIONS

     >>CLICK ON THE couchbase-server-enterprise_6.5.0-macos_x86_64.dmg
     >>DRAG THE Couchbase Icon into Applications
     >>Eject the mounted DMG file
    
  4. Go to Applications and lauch the ‘Couchbase Server’ by clicking on it

    >> hit okay to the initial Internet warning dialog.
    
  5. Don’t configure yet, shut down couchbase

     >> go to top tool/menu bar in the and use the Couchbase icon menu and select "Quit Couchbase Server"
    
  6. for 6.5 GA LET’S CHANGE THE DEBUG PORT (the macOS source file here is different than LINUX)

     cd /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/etc/couchbase
     cp -p static_config.in static_config.in.orig
     echo "{eventing_debug_port, 9444}." >> static_config.in
    
  7. Check your work

     diff static_config.in.orig static_config.in
     # 39a40
     # > {eventing_debug_port, 9444}.
     # cd ~/Downloads
    
  8. Now remove config.dat YOU WILL LOSE ANY DATA, you must do this

     rm ~/Library/Application\ Support/Couchbase/var/lib/couchbase/config/config.dat
    
  9. Go to Applications and launch the ‘Couchbase Server’ we will be using the NEW debug port 9444 instead of 9140

1 Like

tq , it helped me lot @jon.strabala