Tag Archives: report errors

java.nio.charset.MalformedInputException: Input length = 1

Project scenario:

Using springboot to build a personal blog system
reference video: reference video link

Problem Description:

Error reported:

20:40:41.091 [restartedMain] ERROR org.springframework.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
	at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:218)
	at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:176)
	at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:171)
	at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:126)
	at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1177)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:287)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseImplicitDocumentStart.produce(ParserImpl.java:195)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
	at org.yaml.snakeyaml.composer.Composer.checkNode(Composer.java:82)
	at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:123)
	at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:507)

Cause analysis:

I remember converting the suffixes of properties files to YML files directly according to the video, and then the Chinese comments on the page became garbled, so I naturally converted them to GBK format, and then the above error was reported

The first possibility is that there is a problem with the encoding format of your application.yml file, which is changed to UTF-8
the second possibility is that your application.yml file is generated by directly changing the suffix of other types of files to YML. At this time, you need to copy all the contents in application.yml, delete them, and then create a new application.yml file, Copy the copied content into it and then run the project, and no error will be reported.

Solution:

Find file coding in the setting of idea

Convert GBK to UTF-8, and then rewrite the Chinese annotation to run normally

Cli4 frequently asked questions about creating projects loglevel error

Command failed: NPM install — loglevel error

Command failed: NPM install — loglevel error & amp& amp;& amp; command failed: npm install –loglevel error –registry= https://registry.npm.taobao.org The reason is whether Taobao image is selected during installationnpm install chromedriver –chromedriver_ cdnurl= http://cdn.npm.taobao.org/dist/chromedriver After completing the operation, re create the project NPM cache clean — force to clear the NPM cache If you choose Taobao image during installation, and the above two steps are not enough – & gt; Re install the following Taobao source NPM install – G cnpm — registry= https://registry.npm.taobao.org

Python TypeError: Unrecognized value type: <class ‘str‘>dateutil.parser._parser.ParserError: Unknow

When I want to convert a column of dates in the data frame into the date format of panda, I encountered this kind of error.

reader = pd.read_csv(f'new_files/2020-12-22-5-10.csv', usecols=['passCarTime'],dtype={'passCarTime':'string'})
pd.to_datetime(reader.passCarTime.head())
Out[98]: 
0   2020-12-22 10:00:00
1   2020-12-22 10:00:00
2   2020-12-22 10:00:00
3   2020-12-22 10:00:00
4   2020-12-22 10:00:00
Name: passCarTime, dtype: datetime64[ns]
pd.to_datetime(reader.passCarTime)
Traceback (most recent call last):
  File "D:\PyCharm2020\python2020\lib\site-packages\pandas\core\arrays\datetimes.py", line 2085, in objects_to_datetime64ns
    values, tz_parsed = conversion.datetime_to_datetime64(data)
  File "pandas\_libs\tslibs\conversion.pyx", line 350, in pandas._libs.tslibs.conversion.datetime_to_datetime64
TypeError: Unrecognized value type: <class 'str'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "D:\PyCharm2020\python2020\lib\site-packages\IPython\core\interactiveshell.py", line 3427, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-99-e1b00dc18517>", line 1, in <module>
    pd.to_datetime(reader.passCarTime)
  File "D:\PyCharm2020\python2020\lib\site-packages\pandas\core\tools\datetimes.py", line 801, in to_datetime
    cache_array = _maybe_cache(arg, format, cache, convert_listlike)
  File "D:\PyCharm2020\python2020\lib\site-packages\pandas\core\tools\datetimes.py", line 178, in _maybe_cache
    cache_dates = convert_listlike(unique_dates, format)
  File "D:\PyCharm2020\python2020\lib\site-packages\pandas\core\tools\datetimes.py", line 465, in _convert_listlike_datetimes
    result, tz_parsed = objects_to_datetime64ns(
  File "D:\PyCharm2020\python2020\lib\site-packages\pandas\core\arrays\datetimes.py", line 2090, in objects_to_datetime64ns
    raise e
  File "D:\PyCharm2020\python2020\lib\site-packages\pandas\core\arrays\datetimes.py", line 2075, in objects_to_datetime64ns
    result, tz_parsed = tslib.array_to_datetime(
  File "pandas\_libs\tslib.pyx", line 364, in pandas._libs.tslib.array_to_datetime
  File "pandas\_libs\tslib.pyx", line 591, in pandas._libs.tslib.array_to_datetime
  File "pandas\_libs\tslib.pyx", line 726, in pandas._libs.tslib.array_to_datetime_object
  File "pandas\_libs\tslib.pyx", line 717, in pandas._libs.tslib.array_to_datetime_object
  File "pandas\_libs\tslibs\parsing.pyx", line 243, in pandas._libs.tslibs.parsing.parse_datetime_string
  File "D:\PyCharm2020\python2020\lib\site-packages\dateutil\parser\_parser.py", line 1374, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "D:\PyCharm2020\python2020\lib\site-packages\dateutil\parser\_parser.py", line 649, in parse
    raise ParserError("Unknown string format: %s", timestr)
dateutil.parser._parser.ParserError: Unknown string format: passCarTime

I’m not a professional, and my English is not good. I can’t understand what’s wrong. I have seen that there is no missing value in the date column of the file, and there is no date that does not conform to the format… This is very strange, welcome to leave a message, thanks in advance!

Solution

When converting, add a parameter errors ='coerce '.

reader = pd.read_csv(f'new_files/2020-12-22-5-10.csv', usecols=['passCarTime'],dtype={'passCarTime':'string'})
reader.passCarTime = pd.to_datetime(reader.passCarTime,errors='coerce') 
reader.passCarTime.head()
Out[120]: 
0   2020-12-22 10:00:00
1   2020-12-22 10:00:00
2   2020-12-22 10:00:00
3   2020-12-22 10:00:00
4   2020-12-22 10:00:00
Name: passCarTime, dtype: datetime64[ns]
reader.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 307707 entries, 0 to 307706
Data columns (total 1 columns):
 #   Column       Non-Null Count   Dtype         
---  ------       --------------   -----         
 0   passCarTime  307703 non-null  datetime64[ns]
dtypes: datetime64[ns](1)
memory usage: 2.3 MB

When installing pyaudio, an error is reported: failed error: portaudio. H: there is no such file or directory

When installing pyaudio, an error is reported: failed error: portaudio. H: there is no such file or directory

 
The operation of pyaudio depends on the portaudio library. You should first install a portaudio library

Portaudio installation steps:

A) Download PortAudio Library http://portaudio.com/download.html , select the latest tgz, upload it to Linux or termux and place it where you want to install it. Termux: I put it in/data/data/com.termux/files/usr/share, and CD it to this directory

B) tar – zxvf file name         Unzip the downloaded files without tar, such as apt get install tar

C) enter the decompressed portaudio file and execute the following commands in turn:

    ./configure

(configure command)

This step is generally used to generate makefile to prepare for the next step of compilation. You can control the installation by adding parameters after configure. For example, the code:./configure – prefix =/usr means to install the software under/usr, and the executable file will be installed in/usr/bin (instead of the default/usr/local/bin), The resource file will be installed in/usr/share (instead of the default/usr/local/share). At the same time, some software configuration files can be set by specifying the – sys config = parameter. Some software can also add – with, – enable, – without, – disable and other parameters to control the compilation. You can view the detailed instructions and help by allowing./configure – help.

In termux, this step is set to

./configure –prefix=/data/data/com.termux/files/usr

    make     compile

    make install     Installation

4. Install pyaudio library, PIP3 install pyaudio

Appium step pit summary — solution

1. There are appium command version and appium desktop version in the computer, After opening appium desktop version, the script will run with an error:
selenium.common.exceptions.webdriverexception: Message: an unknown server-side error occurred while processing the command. Original error: cannot start the ‘com. XXXX’ application.
main meaning: an unknown server-side error occurred while processing the command

Check:
I found that the command line version (1.20.2) is inconsistent with the desktop version (1.14.1), appium – V, view version

Solution:
close the desktop version, enter appium in the CMD to execute the command line version, execute the script, and it can run successfully
solution 2: upgrade the desktop appium version or reduce the appium command line version

Error: not found; no service started

Sometimes it’s a headache to report an error. If you have a problem with your own code, you can still solve it. However, if there is a problem with the as tool, it’s embarrassing!
I’ve heard that as2.3 has its own bug before, but I haven’t encountered it. Fortunately, I did today! All kinds of search information, over the wall!
The error is as follows:

Starting service: Intent 
{ act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
cmp=com.xxx.xxx.constrain/com.android.tools.fd.runtime.InstantRunService }
Error: Not found; no service started.

Solution:
first, simply and crudely re install as2.3 (I use version 2.3)
Second, upgrade as in the case of upgrade. At present, my as is upgraded from 2.3 to 2.3.1
and above, and all the problems can be solved

Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…

[operation environment]

jdk1.8+eclipse+apache tomcat v7.0

 

[phenomenon]

Code running error org.apache.catelina . core.StandardContext listenerStart

Error creating bean with name ‘sqlSessionFactory’ defined in URL [file:/E:/apache-tomcat-7.0.63-windows-x64

 

Tomcat error

 

Reason: no Tomcat jar package added

Select the project, right-click, select build path — & gt; add Libraries… — & gt; select server runtime — & gt; next — & gt; select Apache Tomcat v7.0 — & gt; OK.

 

 

 

 

 

Attributeerror: object has no attribute

Error report: in the front-end test, the interface sends a put request, the error report occurs on the interface, the request cannot respond, and the server status code is 500.

Error analysis: semantically, “the object does not have a XXX attribute.”.

Look up most of the information, most of the problems with Python. The front end of this project uses react, and the back end uses the djongo framework of Python.

The main reason for asking the back-end colleagues is that the data type of the parameters passed by the front-end is incorrect. The back end needs a string “true”, but the front end passes a Boolean “true”, which causes the above problem.

In case of such a problem, the error code returned by the server is 500. For such a problem, usually ask the back-end colleagues to check the log for common analysis.

Solution of running error reporting attributeerror: ‘rectangle’ object has no property ‘normalized’

Have a problem

When running the code, the following error prompt appears:

AttributeError:'Rectangle' object has no property 'normed'

resolvent

The reason is that the library has been updated and there is no such attribute. Delete the normal in the code (no error, but it seems that it can’t be drawn)

Replace the normal attribute in the code with density , and add an attribute stacked = true .


Thank you for your comments.

Error: invalid permission for adding an object to repository database

➜  atd git:(b4.232) ✗ git pull
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 78 (delta 60), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed

Git error

insufficient permission for adding an object to repository database 

Because the. Git directory of the project has the permission of root,

The solution is to switch to the root super administrator and modify the user of the file as the current computer user

chown -R xxxx: .git