Tag Archives: Technology accumulation

How to Solve k8s Nodal issues: /sys/fs/cgroup/memory/docker: no space left on device\““: unknown.

When some nodes of k8s run for a period of time, an error is reported: sys/FS/CGroup/memory/docker: no space left on device \ “: unknown

The docker’s memory is full, probably because SELinux = is on

Permanent closure solution:

VI/etc/SELinux/config, change SELinux = enforcing to SELinux = disabled, then save and exit

Then restart the computer

The node can be used after re running

Of course, this is: basic entrance examination of intelligent gtalent operation engineer

If it is only used temporarily, then directly: setenforce 0

docker: Error response from daemon: OCI runtime create failed: container_ linux.go:345: starting container process caused “process_ linux.go:275: applying cgroup configuration for process caused \”mkdir /sys/fs/cgroup/memory/docker: no space left on device\””: unknown.
ERRO[0000] error waiting for container: context canceled

Ajax can’t download file to browser

Recently, I encountered such a function when I was working on a website. In the page as shown in the figure, when users need to click the link, they can judge whether the corresponding excel file is stored in the server in an asynchronous ajax way. If not, they will be prompted that they have not found it, and if so, they will download it to the local user.

 

Of course, this is a very simple problem. Just write Ajax in a normal way. But when the server returns the file content to the browser in binary form, the browser’s Ajax throws an error. It’s about parseError, invalid XML, PK, etc.

 

 

The reason for this problem is not that there is a problem with the server-side code or JavaScript code, but that downloading files through AJAX is forbidden. For security reasons, JavaScript is not able to save the file to the local, so Ajax takes this into account. It only accepts the return value in XML, Ajax and JSON format, and the binary return format will throw this exception.

 

How to solve this problem?use window.location =URL is OK. Some people will ask, such as the above figure, when you click the download link on a certain page, because it has changed window.location Is the current page about to jump?In fact, I use Chrome browser. When I click that link, the next file save dialog box will pop up directly, and the address bar of the page has no change. At this time, if you click save, the file will be kept. If you click cacel, the operation will be cancelled. During the process, the current page will be kept and will not jump to other pages.

 

 

From personal blog www.sunrobin.net

 

 

A first chance exception of type ‘ System.NullReferenceException ‘when occurred, you did encounter a bug

Maybe when you debug the program in Viusal studio, you find that output windows prints out a line of information about a first chance exception of type ‘ System.NullReferenceException ‘occurred, you may have wondered what is the first chance exception, Does this sentence mean that there is something wrong with my code?But if there is a problem, why does my program not throw any exception but display such a message in output windows?If I don’t look at the output window, I may not find this message at all.

 

Let’s talk about the first chance exception. When you are debugging a program in VS, when there is a problem with the program, it is the debugger (which can also be understood as vs itself) who first catches the exception. At this time, vs has to decide how to solve the problem.

 

    is to stop now, throw out the problem, pop up a dialog box, tell the user that there is a problem in your program, and let the user decide whether to continue or stop.

 

    leave it alone. If the user has a try catch, let the user’s own code process it. If there is no try catch, let the runtime capture it and then let the runtime process it. But when debugging, it is still vs to capture again.

 

 

So what does vs rely on to decide how to deal with it?Under debug settings, if CLR exception is checked, vs will catch an exception. It will not only print a message in output windows, but also pop up a dialog box to notify the user.

 

If there is no check here, then vs does nothing, just like there is no such thing.

For example, like the following code,

If vs catches and throws, the program stops at line 36 and notifies the user. If vs lets it go, the program jumps to line 39 and continues to execute the processing logic of the code.

Two concepts need to be understood. When C # programs are really running, it is runtime. As the top manager, exception will be thrown here. When debugging in VS, VS Runtime is the top manager, exception will throw it here, so that VS can notify users through the form of dialog box. First chance exception will inform the user through the pop-up box. If the user selects continue, the program can continue to run. However, if the code does not have a corresponding capture mechanism to deal with it, it is thrown to vs runtime again and captured, then it is called second chance exception. At this time, a dialog box will pop up again, but this time, the code will not continue to run.

Moreover, it should be noted that if we do not check the above option, vs will throw an exception dialog box on line 39 when calling the program.

But if we check it, we will throw an exception dialog box where the 52 line exception actually occurs.

Some people will ask if I should check it?If your project references a heavyweight tool like NHibernate, the DLL itself is likely to throw exceptions in many places, but the DLL itself has try If you check “catch”, vs will capture the catch code block before it is processed, and then inform the user. There will be a lot of such cases. As a result, the user will point to a lot of continue dialog boxes. Don’t check it at this time.

Reference link:

https://blogs.msdn.microsoft.com/davidklinems/2005/07/12/what-is-a-first-chance-exception/

http://dzimchuk.net/post/when-a-first-chance-exception-of-type-xxx-occurred-you-really-have-a-bug