Cannot open ActiveMQ Admin page after starting the server? - macos

I'm not sure if I started the server or not. But, I cannot open the admin page on the browser.
Am I missing anything else?

One thing you should generally always do is check the broker log and see if there's an error. Also running the broker in foreground after you alter the configuration will show you any errors that might be there you can run:
./bin/activemq console
To run in foreground mode.
Beyond that its hard to help since you haven't provided information like you configuration or done a 'ps -ef | grep activemq' etc.

check your /conf/activemq.xml file and make sure <import resource="jetty.xml"/> is included

Related

Snowsql external browser authentication - Windows/Chrome

I've installed the Snowsql CLI tool (v1.2.16) and tried connecting to Snowflake using a command similar to snowsql -a <account details> -user datamonk3y#domain.com --authenticator externalbrowser.
For myself, and a few other colleagues, a pop up window appears which will allow us to authenticate. Unfortunately this isn't the case for some of my other colleagues...
I've not found anything obvious, but the authentication browser window simply isn't popping up for some users (Around half of us), therefore the connection is aborting after time out.
We're all using AWS workspaces with the same version of windows, same version of chrome and the same version of Snowsql. There's nothing I can see in the chrome settings that could be causing this. I'm also able to change the default browser to Firefox and I still authenticate fine.
Logging into the UI works for everyone too...
The logs don't really give much away, the failed attempts get a Failed to check OSCP response cache file message, but I think this is because the authentication isn't initiated with the server.
When I check my local machine (C:/Users/<datamonk3y>/AppData/Local/Snowflake/Caches/) I see a ocsp_response_cache.json file, but this isn't there for my colleagues who aren't able to log in.
As #SrinathMenon has mentioned in the comments below, adding -o insecure_mode=True to the login command will bypass this issue, but does anyone have any thoughts as to what could be causing this?
Thanks
Try by using the turning off OCSP :
snowsql -a ACCOUNT -u USER -o insecure_mode=True
The only root cause I see this issue happening is when the request is not able to reach the OCSP URL and that is failing.
Adding the debug flag in snowsql would give more details / information. Use this to collect the debug logs:
snowsql -a <account details> -user datamonk3y#domain.com --authenticator externalbrowser -o log_level=debug -o log_file=<path>
In my case, what worked was including the region in account name. So instead of -a abc1234, you would do something like -a abc1234.us-east-1.
https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#format-2-legacy-account-locator-in-a-region explains this a little, but basically you use the first part of the web console URL, eg: https://abc1234.us-east-1.snowflakecomputing.com/ (this only works with classic console)

Kafka: unable to start Kafka - process can not access file 00000000000000000000.timeindex

Kafka enthusiast, need little help here. I am unable to start kafka because the file \00000000000000000000.timeindex is being used by another process. Below are the logs:
[2017-08-09 22:49:22,811] FATAL [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.nio.file.FileSystemException: \installation\kafka_2.11-0.11.0.0\log\test-0\00000000000000000000.timeindex: The process cannot access the file because it is being used by another process.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at kafka.log.Log$$anonfun$loadSegmentFiles$3.apply(Log.scala:311)
at kafka.log.Log$$anonfun$loadSegmentFiles$3.apply(Log.scala:272)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732)
at kafka.log.Log.loadSegmentFiles(Log.scala:272)
at kafka.log.Log.loadSegments(Log.scala:376)
at kafka.log.Log.<init>(Log.scala:179)
at kafka.log.Log$.apply(Log.scala:1580)
at kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$5$$anonfun$apply$12$$anonfun$apply$1.apply$mcV$sp(LogManager.scala:172)
at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:57)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[2017-08-09 22:49:22,826] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)
I had the same issue. The only way I could figure it out that was just delete the C:\tmp\kafka-logs directory. After that i was able to start up the kafka server.
You will lose your data and the offset will start from 0.
This seems to be a known issue that gets trigerred on Windows after 168 hours have elapsed since you last published the message.
Apparently this issue is being tracked and worked on here: KAFKA-8145
There are 2 workarounds for this:
As suggested by others here you can clean up your directory containing your log files (or take a back up and have log.dirs point to another directory). However by this way you will loose your data.
Go to you server.properties file and make following changes to it. Note: This is temporary solution to allow your consumers to come up and consume any remaining data so that there is no data loss. After having got all the data you need you should revert to Step 1 to clean up your data folder once and for all.
Update below property to prescribed value
# The minimum age of a log file to be eligible for deletion due to age
log.retention.hours=-1
Add this property at the end of your properties file.
log.cleaner.enable=false
Essentially what you are doing is that you are saying to the Kafka broker to not bother deleting old messages and that the age of all messages is now infinite i.e they will never be deleted. As you can see this is obviously not a desirable state and hence you should only do this in order for you to be able to consume whatever you need and then clean up your files / directory (Step 1).
IMHO that the JIRA issue mentioned above is worked on soon and as per this comment
looks like it may soon be resolved.
All answers give you a same solution by remove data, not how to prevent the problem.
Which actually, you just need to stop Kafka and Zookeepter properly.
You just have run these two commands in order
kafka-server-stop.sh
zookeeper-server-stop.sh
Then next time when you start, you will see no problems.
java.nio.file.FileSystemException: \installation\kafka_2.11-0.11.0.0\log\test-0\00000000000000000000.timeindex: The process cannot access the file because it is being used by another process.
00000000000000000000.timeindex is being used by another process. So you can delete the process by using following command
$ ps aux | grep zookeeper
$ sudo kill -9 <PID>
Here PID is the zookeeper's process ID.
The problem is not fixed yet. It is described here: https://issues.apache.org/jira/browse/KAFKA-1194
There are 2 ways for temporary solution given by ephemeral972:
[Recommended] You need to clean up the broker ids in the zookeeper path /brokers/ids/[]. Use the zk-cli tool delete command to clean up the paths. Start your brokers and verify it registers with the coordinator.
The other way of resolving this is to change your broker-id from kafka server config and restarting the broker. However, this would corrupt your partitions and data is not recommended
I got this error too while running kafka on windows.
You can avoid this error by changing the default config in sever.properties file.
Please follow these steps:
Go to the config folder of kafka installation.
Open the Server.properties file
you will see the config
A comma separated list of directories under which to store log files:
log.dirs=/tmp/logs/kafka**
Change the value of log.dirs=/tmp/logs/kafka to some other value, for example:
log.dirs=/tmp/logs/kafka1
Now start your kafka-server again.
This should solve the issue.
I faced the same issue and restarting kafka and zook then windows didn't work for me.
what works for me (Don't reproduce that in Production mode, I'm not sure it will works fine but it could be acceptable with a DEVELOPMENT kafka server.
on a dev kafka server:
go to the concerned directory (for instance \installation\kafka_2.11-0.11.0.0\log\test-0)
and delete all files other than :
00000000000000000000.index
00000000000000000000.log
00000000000000000000.timeindex
leader-epoch-checkpoint
Then restart kafka, it was ok for me, after restarting (zookeeper then kafka), kafka add a .snapshot file and everything was ok.
Solution : In Windows delete logs manually. And restart kafka-server or broker
Finding log storage location.
Go to server.properties
############################# Log Basics #############################
A comma separated list of directories under which to store log files
log.dirs=/This Location/
Followed the approached suggested by #SkyWalker
Follow the below steps:
List item.Open zkCli and get everything inside broker. See the below screenshot.
Go inside topics and press double tab. You will get all the topic listed here.
Delete each topics then.
I faced the same problem and this is how i resolved it.
Change the log.dirs path in server.properties
log.dirs=C:\kafka\logs
Another solution which worked :
delete all files from the below dir wherever configured
kafkalogs\test-0
I had similar issue on windows , partly because i had deleted couple of topics ( since i found no other way to just flush only the messages from those topics ).
This is what worked for me.
Change the logs.dir in config/server.properties to new location
Change the dataDir in config/zookeeper.properties to new location
Restart zookeeper and kafka
The above obviously will work when you have no other topics other than what you deleted on the zookeeper/kafka to cater for , if there are other topics which you still want to retain configuration for , i believe the solution proposed by #Sumit Das might work. I had issues starting zkCli on my windows and i had only those topics which i deleted on my brokers , so i could safely do the above steps and get away with it.
I configure tmp path as below: (in file ./config/server.properties)
log.dirs=d:\tmp\kafka-logs
then I changed from backslash '\' to '/':
log.dirs=d:/tmp/kafka-logs
and create folder to solve the problem
For me it worked after renaming the log files
log.dirs=D:/kafka_2.13-2.4.0/data/kafka to kafka1.
Also modified the log.retention.hours=1 , to avoid repetition of issue
This is for windows:
Kill the process running on port "9092" and "2181" using below commands in powershell.
netstat -aon | findstr 'yourPortNumberHere'
taskkill /pid <pid here> f
Run above commands for both the ports.

XAMPP - Apache could not start - Attempting to start Apache service

While trying to start Apache using XAMPP, I was receiving - "Attempting to start Apache service..." message in XAMPP UI. No further details were available.
Where can I see the logs (I was running XAMPP as Admin) ?
IF PORT 80 IS NOT THE ISSUE!
Check to see if the port 80 is in use first as this can be an issue.
You can do this by typing "netstat -an" into cmd. The look for 0.0.0.0:80 under Local Address, if you find this is in use then follow the solution from #Karthik. However, I had a similar issue but my port 80 was not in use.
My XAMPP had wrong paths locations, steps to fix this:
1.Find out the Apache version you are using, you can find this by looking in Services (Control panel, Admin Tools, Services) and finding Apache in my case it was listed as Apache2.4
2.Close XAMPP.
3.Run cmd as admin.
4.execute 'sc delete "Apache2.4"' (put your version in place of mine and without the surrounding ' ', but with the " " around Apache).
5.execute 'sc delete "mySQL"', again remove the '' when you type it.
6.reopen XAMPP and try starting Apache
If you are having trouble with FileZill, Mercury, or Tomcat you could try it here too, but I have not tested that myself.
Hope this helps!
I realized it was a port issue since I was running IIS and other web servers in my machine. But I was more interested to see a detailed error message with the port number in the UI.
Seems like it was not logged in the UI or log file (at least in my case), but in the Event viewer (Control panel -> View Event Logs). Under the Even viewer -> Windows Logs -> Application
I could see a permission error something like the below one:
An attempt was made to access a socket in a way forbidden by its access permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:443
To fix this permission issue for SSL port, Please change the below line in httpd-ssl.conf (C:\xampp\apache\conf\extra)
# When we also provide SSL we have to listen to the
standard HTTP port (see above) and to the HTTPS port
Listen xxx
Replace XXX with any valid port number that is open in your machine
If you are having issues with Port 80, then change the httpd.conf file (C:\xampp\apache\conf)
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 127.0.0.1:8000
I have also summarized other solutions that I came across:
Most often Skype blocks the Apache port. So terminate it and try again.
Find the process id (PID) that is using the Blocked port ( netstat -ano) and kill the corresponding process in Windows Task Manager.
For those who have accidentally (or not) changed one of the .conf files and apache does not run even after trying all the above solutions.
One easy way to track where the issue is located, is to run Apache via command prompt:
(On windows) : open command prompt as admin then navigate inside the bin folder of Apache , next run
httpd in order to run apache
C:\xampp\apache\bin\httpd
For my case it was :
someone had added a virtual host in the specific file that caused the problem . I commented the lines and Apache ran fine.
start xampp (as administrator),
(1) right click C:\xampp\xampp-control.exe, and run as administrator.
(2) unistall service module and then install service module.
(3) now try start the apache and mysql.
Check your DocumentRoot path (in httpd.conf); a typo there can cause this problem.
Had the same issue while updating to PHP7.2
Problem:
First I closed skype and then checked whether port 80 is not an issue. How you can check that? See #AlexT comment above.
In my case, port 80 wasn't an issue. So now I had to figure out what was wrong. So I checked Error Logs Control Panel > Even viewer > Windows Logs > Application and found following error against Apache2.4
httpd.exe: Syntax error on line 520 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 18 of C:/xampp/apache/conf/extra/httpd-xampp.conf: Cannot load C:/xampp/php/php7ts.dll into server: The Apache service named is not a valid Win32 application.
Which means I had installed wrong PHP version. Actually I downloaded win64 version while the required version was Win32 for me.
So I downloaded correct version from: Download PHP 7.2.0 extracted it in C:/xampp/php folder, restarted the apache and it worked :)
I had the same issue, executing "setup_xampp.bat" in xampp folder solved my issue.
I had the same problem but it was because I had a previous version of xampp already installed and I tried to install a newer version. I had installed the newer version in another file directory (I had named the file directory xampp2). I solved the problem by uninstalling the newer version, renaming the old one (I renamed it xamppold) and I installed xampp again.
I guess if you haven't installed xampp in another file directory , it should be enough to reinstall xampp. If you are worried about your files , you always can make a backup before reinstalling xampp.
I solved the problem after watching the xampp activity log (the list of the bottom) and realizing xampp was trying to open the custom file path but I had another route path. If the first option didn't work, at least you can scroll up in the activity log and see what's error you get while starting as admin and trying to re install the Apache module or trying to start the module.
You may wander why I didn't just simply uninstall the whole thing from the beginning , and the answer would be because I had to tweak a couple of things in xampp for some different projects (from changing the ports , to add .dll to run mongo.db in Apache), and I was just too lazy to re-do everything again :b
I hope my answer can be helpful for anyone since this is my first time writing in stackoverflow :)
Cheers
In my case, with the same problem and Xampp window, I had copied \apache\conf\extra\httpd-vhosts.conf entries from an old Xampp version to a newly installed one so I could continue to open local projects in browsers. One of the vhosts paths was wrong. After deleting that entry Apache started without problem.
The reference by #Karthik to "in the Event viewer (Control panel -> View Event Logs" saved me time. It's all too easy to presume Xampp logs will point to the problem. It doesn't.
Also check if your xampp is installed in the main directory like C or D or E and not in or within a folder of that directory? i.e. ( "D:/Xampp" or is it "D:/something/Xampp") if its not in the main path of the directory, it will show this error.
copy your xampp directory from "D:\Something\Xampp" to "D:"
So it becomes like this "D:\Xampp"
and the issue will be resolved.
Starting Xampp as a console application (simply by doubleclicking xampp_start.exe in the Xampp root folder) was the only thing that worked for me on Windows 10 (no Skype, no Word Wide Web Publishing Service). WampServer and UwAmp also didn't work.
I had a hard-coded IP in httpd.conf and my local IP had changed which was causing my issue, changed IP over and all worked again
My scenario was different after I tested all the possible options. If you have changed the ports and still get the same problem, well here's something you can try out. This was done in Windows 7.
Step 1: Confirm the cause of the error by going to Control Panel -> System and Security -> Administrative Tools -> Event Viewer -> Windows Logs -> Application -> Error. Mine said "The Apache service named reported the following error:
httpd.exe: Syntax error on line 424 of C:/xampp/apache/conf/httpd.conf: Cannot load c:\xampp\php\php5apache.dll into server: The specified module could not be found." So I needed to change \php5apache.dll to the version of my php and apache version installed which was php7apache2_4.dll
Step 2: To get the correct name for your .dll php and apache file, got to C:\xampp\php. You will see something like php7apache2_4.dll with other files in the folder.
Step 3: Go to C:/xampp/apache/conf/httpd.conf and edit the configuration file and change "c:\xampp\php\php5apache.dll" to "c:\xampp\php\php7apache2_4.dll" in my case. Make sure you open the file as administrator save changes made.
Step 4: Run the xampp server and everything should work fine. Do not forget to shut down the xampp server before doing the changes to the apache configuration file.
Hope this helps. Cheers! :)
Try to install x86 version of XAMPP. The default XAMPP version on their website is x64 (maybe because I'm using x64 Windows 7).
download link here
I had this issue when I installed under Program Files, which they do not recommend due to write issues. This might only be a problem if you are not logged in as an admin and use a password to install. I just uninstalled and installed in a directory that did not need admin privileges.
Make sure Apache didn't get Disabled in Services (Control panel, Admin Tools, Services). If it's Disabled then Set it to Manual and it should run. That was my case, I found Apache Disabled.
Solution for my particular scenario (It had been working a couple days before getting borked):
Port 80 was not the problem, but something I had done while messing around with Services and Startup.
Type msconfig on Windows' Start menu
Click System Configuration
Screenshot for System Configuration
In the Services tab, search for Apache24 (Click "Hide all Microsoft services" in the checkbox at the bottom of the window to make it easier to find)
If its checkbox isn't checked, check it
If it was already checked, then this guide isn't going to help. However if it is:
Click OK, your PC will have to restart
Try once again! In my case Apache was already running once I opened Xampp
I had the same issue.Just click on services button.Then find apache and right cick > properties > set startup type as Automatic/ Manual. Now close apache and try again.It will work!
For me it wasn't a port or service issue; I had to re-run the XAMPP setup script. Although this didn't directly fix the issue for me, the script was much more verbose than the XAMPP log, pointing me in the right direction to actually solve the problem.
From the XAMPP GUI, click on Shell, type set, press Tab to autocomplete to the setup_xampp.bat file, and then press Enter to run it.
In my case I got the following output:
[ERROR]: Test php.exe failed !!!
[ERROR]: Perhaps the Microsoft C++ 2008 runtime package is not installed.
[ERROR]: Please try to install the MS VC++ 2008 Redistributable Package from the Mircrosoft page first
[ERROR]: http://www.microsoft.com/en-us/download/details.aspx?id=5582
This particular error is misleading. Although it specifies the Visual C++ 2008 Redistributable Package, PHP 7.4.x requires the Visual C++ 2019 Redistributable Package.
After installing that and following the prompt to restart, sure enough I'm now able to start Apache as normal.
make sure no space in front of the port number if you ever edited it.
From Xampp control panel, click on config (next to Apache), then choose Apache(httpd.config), search for listen 80 and change the port to another port.
If nothing works with you, I would suggest you download MAMP and use it instead.
It does the same thing, if not better.
Comment this lines from httpd.conf:
# Virtual hosts
#Include etc/extra/httpd-vhosts.conf
In the case you're using them it may solve.
when i run xampp control panel normal:
I had been run
I can’t start apache
So, I will run it with administrator:
I can run apache

Apache 2 - reload config on Windows

I have a PHP script that modifies my httpd.conf file, so I need to automatically reload it in Apache.
On Linux, there is graceful restart, but on Windows (I use the restart command) it terminates all the current connections. Is there a command as graceful restart on Windows? Is there a workaround on this?
Yes, you should use the -k switch.
httpd.exe -k restart or apache.exe -k restart
More info here has well. http://www.zrinity.com/developers/apache/usage.cfm
Edit:
It shouldn't that is the point of Graceful. Notice I used the -k. That is not the same as a normal restart. It let's the current sessions complete their task while the config is being reread, so that it will start taking new requests immediately.
From the documentation:
The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they're not serving anything). The parent re-reads its configuration files and re-opens its log files. As each child dies off the parent replaces it with a child from the new generation of the configuration, which begins serving new requests immediately.
http://httpd.apache.org/docs/2.2/stopping.html#graceful
It's doing what you are asking for.
Edit 2:
Adding this link and gave both possible versions because some people think you there is only one specific way to do something instead of search themselves.
http://httpd.apache.org/docs/2.4/platform/windows.html#wincons
I think I'm just going to delete this answer because either people can't read or if it doesn't work for someone it gets a DV. There are different windows versions made by different developers. If it doesn't work look for the answer from them. Even Linux has different commands depending on the distro. geez
In the newest Apache 2.4.20 VC10 the "httpd -k restart" command actually DOES do a graceful restart. It won't drop any connections, for example if somebody is downloading something from your server, it WILL NOT interrupt this process. One more proof is that "-k restart" will not reset your server statistics that mod_status provides, won't even alter the "Restart Time" value.
Although "httpd -k graceful" and "httpd -k graceful-stop" commands are available in Windows, but they will not work giving an error "couldn't make a socket".

Can't change log detail levels permanently with a Jython script (WAS 7)

I'm trying to change WebSphere's Log Detail Levels with a Jython script:
..
AdminTask.setTraceSpecification('[-serverName server1 -nodeName qnode -traceSpecification com.ibm.*=all=enabled]')
AdminConfig.save()
..
After successfully running the script I'm checking "Logging and Tracing > {server_name} > Diagnostic trace service > Change log detail levels. The Runtime tab reflects the setting (the traceSpecification) I've entered in my script, but the Configuration tab remains unchanged, so, my setting doesn't get saved to configuration. I've tried restarting my server, so I'm sure about that's the case.
According to setTraceSpecification's documentation, this "command also saves the trace specification in configuration." Well, not in my case:) Do you have any idea what I'm doing wrong?
Any help would be much appreciated
As I've found out, setTraceSpecification() also has a persist parameter which has to be set if you want to change your setting permanently to WAS configuration:
..
AdminTask.setTraceSpecification('[-serverName myserver -nodeName mynode -persist true -traceSpecification com.ibm.*=all=enabled]')
AdminConfig.save()
..
Unfortunately, WAS 7 InfoCenter doesn't have a single word about this option, while WebSphere CloudBurst Appliance InfoCenter has an example which includes it.
I think you may need to also save the configuration in your script:
if (AdminConfig.hasChanges()):
AdminConfig.save()

Resources