log writing failed. "\xC3" from ASCII-8BIT to UTF-8 - ruby-on-rails-3

I am developing rails based api and I used to always get this warning, log writing failed. "\xC3" from ASCII-8BIT to UTF-8.
Does any body have any idea why this warning appears?

Related

VS code failed to load extensions and failed to install new extension after an update

Today I reopen my VS Code after several days, found the extensions that I installed and used for a long time disappeared totally, and it recommended me to install extension for java. OK, I followed the recommends to install extension, and failed.
I checked my Code version, it's the latest version surely.
Then I dipped into the log and tried to install some other extensions, and found the failure always related to one js file sharedProcessMain.js. The detail log is as following:
2023-02-16 09:32:06.725 [error] SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.factory (vscode-file://vscode-app/d:/Users/MI/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)
2023-02-16 09:32:06.771 [error] Unexpected end of JSON input: SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.factory (vscode-file://vscode-app/d:/Users/MI/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)
If anyone who can provide any suggestion? Thank you very much!
On what OS are you running?
I use Windows and I faced the same problem yesterday. Solved it by
Closing VSCode
Removing the entire folder %appdata%\Code
Removing the entire folder %userprofile%\.vscode
Starting VSCode
Hope this helps.

Mobilefirst cli build failed : reading info.plist file 1-byte UTF-8

We have a mobilefirst 7.0 hybrid application project that includes iOS and android native environment.
We want to use mobile first cli 7.0 on windows 7 to build project and generate build-time resources after we checkout this project from git server.
And it fails when it began to parse info.plist of iOS project.
The error message below is what I got from mfcli:
[Error:
BUILD FAILED
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:135: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:341: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:351: The following error occurred while executing this line:
D:\programs\IBM\MobileFirst-CLI7\mobilefirst-cli\node_modules\generator-worklight-server\lib\build.xml:330: Failed building application: com.worklight.builder.exception.WorklightBuildException: com.worklight.builder.exception.WorklightBuildRuntimeException: Resource Manager - Problem reading info.plist file 1-byte UTF-8 �ǦC���L�Ħ줸�� 1�C Nested exception: 1-byte UTF-8 �ǦC���L�Ħ줸�� 1�C
Total time: 18 seconds
]
What does it mean "Resources Manager -Problem reading info.plist file 1-byte UTF-8"?
Our git local repository on windows 7 was set to core.autocrlf = true.
There are Traditional Chinese characters in info.plist file, therefore this issue could be related to character settings.
Use a .gitattributes file to control line endings (do not rely on core.autocrlf) and explicitly exclude plist and other binary files from line ending conversion.
For example:
* text=auto
*.plist binary
The MFP CLI does not change the encoding of files.
It sounds like the Git server - perhaps the fact that it is hosted on Windows - indeed affects the encoding of the files.
The files should be UTF-8.
After further more investigation, we found out that this issue is definitely related to mfcli.
Perhapes mfcli on windows does not accept non ascii code characters in Info.plist. We could fix this problem easily by applying Localized strings for info.plist file in ios project.

After upgrading to rails 3.2 I see ActiveRecord::Fixture::FormatError: a YAML error occurred parsing

I see the following error after upgrading to rails 3.2.12 with ruby 1.9.2.
ActiveRecord::Fixture::FormatError: a YAML error occurred parsing /SampelRails/user_properties.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html
The exact error was:
Psych::SyntaxError: couldn't parse YAML at line 1 column 0
I have doubled checked the yml files and they seem to be indented properly.
according to https://github.com/rails/rails/issues/2731 this issue seem to be fixed in rails 3.1.1.
just experienced the same issue but the problem was that i was saving my VCR cassettes in test/fixtures/vcr_cassettes/*.yml.
ActiveRecord::Fixture gets confused by yml files with content other than AR fixture data.
The link posted by nathanvda really worked.
Try adding this at the beginning of config/boot.rb
require 'yaml'
YAML::ENGINE.yamler= 'syck'
Rails 3 - 'Couldn't parse Yaml'
I just had the same issue. Solved it by removing a dummy fixture file from fixtures directory. That file had nothing but comments in it.

How to solve the following rails 3 error: ArgumentError (Syck is not missing constant BadAlias!)?

I've got a strange error with a rails 3.0.3 application running on ruby 1.9.2, as a matter a fact it doesn't run yet, beacause I get the following error:
ArgumentError (Syck is not missing constant BadAlias!):
Rendered /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
Rendered /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (14.4ms)
Rendered /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.4ms)
Is because of the ruby version? Or how can I solve this?
-- later edit:
On ruby 1.8.7 EE, I have no such error.
After searching and searching the internet, I started to look at all my YAML in my app, and I validate each file using: http://yaml-online-parser.appspot.com/, and I've got errors like:
while parsing a flow node
expected the node content, but found ':'
in "<unicode string>", line 147, column 13:
order: [:day, :month, :year]
Therefore everything was because the yaml errors. The problem is with unicode, in seems that its different on ruby 1.9.2 than in 1.8.7.

Carrierwave Rmagick Segmentation Fault on Wrong Photo Extension

I got a segmentation fault when I attempted to upload an image to my site on Heroku using Carrierwave with Rmagick.
This is part of the error log output:
ruby: jpc_dec.c:1072: jpc_dec_tiledecode: Assertion `dec->numcomps == 3' failed.
/app/.bundle/gems/ruby/1.9.1/gems/carrierwave-0.5.4/lib/carrierwave/processing/rmagick.rb:248: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
After investigation, the segmentation fault occurs because I attempted to upload a JPEG2000 file with a .jpg extension instead of the correct .jp2 extension.
Is this a bug with Rmagick?
More importantly, is it possible to prevent the users of my site from triggering this segmentation fault by sending an image with the wrong extension?
Thanks!
I doubt this will be its only error.
You could use another tool, like 'file' to verify the file format.
Also you should think about a way that makes it possible to recover if ruby crashes.
You could just run an extra process in the background. But you should make sure that
you have extra checks in place so that you can respond when someone tries to repeatedly crash your software. Otherwise you're an easy denial of service target.