Symfony 4.3.5 - locale loading nonexistent public - localization

In Symfony 4.3.5 when using locale in url (e.q. http://127.0.0.1:8000/en/example), framework starts loading nonexisting public route to resources;
/en/images/like-icon-58x25.png instead images/like-icon-58x25.png.
I got 404 on each of these resources when server tries to access public route with locale prefixed in route, only plain HTML loads:
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50790 [404]: /en/css/bootstrap.css
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50794 [404]: /en/css/style.css
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50792 [404]: /en/css/fonts.css
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50796 [404]: /en/images/logo-proizd-team-2019-web2.png
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50798 [404]: /en/images/project-1-195x164.jpg
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50800 [404]: /en/js/core.min.js
[Wed Jan 29 19:17:30 2020] 127.0.0.1:50802 [404]: /en/js/script.js
How to solve this problem. Could not find similar problems and solutions.

I've found solution.
Since I'm using Twig, assets must be put into asset() function.
e.g.
src="{{ asset('images/like-icon-58x25.png') }}"

Related

OpenEdx 500 Server error after installing Custom them

Already posted in Bitnami community. www.community.bitnami.com/t/500-server-error-after-installing-custom-theme/52736
I'm trying to install a open edx theme from
Links: www.github(dot)com/dadasoz/edx-bootstrap-theme. and following steps at
docs.bitnami(dot)com/installer/apps/edx/#how-to-install-a-custom-standford-theme
** I'm getting 500 internal server error.
Apache Logs
[Wed Oct 18 00:51:26.682720 2017] [:error] [pid 25207] File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/mako/runtime.py", line 890, in _exec_template
[Wed Oct 18 00:51:26.682723 2017] [:error] [pid 25207] callable_(context, *args, **kwargs)
[Wed Oct 18 00:51:26.682726 2017] [:error] [pid 25207] File "/tmp/mako_lms/cd6b613ed628f9f43e33fb106119f020/edx-bootstrap-theme/lms/templates/main.html.py", line 293, in render_body
[Wed Oct 18 00:51:26.682729 2017] [:error] [pid 25207] runtime._include_file(context, (static.get_template_path('header.html')), _template_uri, online_help_token=online_help_token)
[Wed Oct 18 00:51:26.682733 2017] [:error] [pid 25207] File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/mako/runtime.py", line 752, in _include_file
[Wed Oct 18 00:51:26.682736 2017] [:error] [pid 25207] callable_(ctx, **_kwargs_for_include(callable_, context._data, **kwargs))
[Wed Oct 18 00:51:26.682739 2017] [:error] [pid 25207] File "/tmp/mako_lms/cd6b613ed628f9f43e33fb106119f020/edx-bootstrap-theme/lms/templates/header.html.py", line 34, in render_body
[Wed Oct 18 00:51:26.682742 2017] [:error] [pid 25207] runtime._include_file(context, (static.get_themed_template_path(relative_path='theme-header.html', default_path='theme-header.html')), _template_uri, online_help_token=online_help_token)
[Wed Oct 18 00:51:26.682746 2017] [:error] [pid 25207] File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/mako/runtime.py", line 625, in getattr
[Wed Oct 18 00:51:26.682749 2017] [:error] [pid 25207] (self.name, key))
[Wed Oct 18 00:51:26.682752 2017] [:error] [pid 25207] AttributeError: Namespace 'static' has no member 'get_themed_template_path'
My site is down now.Can someone please help me in fixing the issue.
I have reached the same error, trying to find more information about the case, I have seen in the theme GitHub repository there is an open issue in which it is said that this theme is not compatible with Eucalyptus.
If your instance is not very old you'll be using Ficus which is the current version released by Bitnami, if the previous version (Eucalyptus) is not compatible with this theme, I'm afraid Ficus will not be either.

CKAN Dataset Upload Page giving a Server

When creating a dataset you are required to either upload the csv or xml file containing the data or link to the data file located on a server. When I attempt to upload a csv or xml file the upload process starts but the page eventually crash with the following message.
Server Error
An internal server error occurred
also see below error in /var/log/apache2/ckan_default.error.log
[Mon Aug 10 19:08:18.934269 2015] [:error] [pid 1243] 2015-08-10 19:08:18,934 INFO [ckan.lib.base] / render time 0.169 seconds
[Mon Aug 10 19:08:21.217534 2015] [:error] [pid 1243] 2015-08-10 19:08:21,217 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:23.832089 2015] [:error] [pid 1244] 2015-08-10 19:08:23,831 INFO [ckan.lib.base] /user/admin render time 0.413 seconds
[Mon Aug 10 19:08:24.430716 2015] [:error] [pid 1243] 2015-08-10 19:08:24,430 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:26.858892 2015] [:error] [pid 1243] 2015-08-10 19:08:26,858 WARNI [ckan.lib.maintain] Function get_action() in module ckan.lib.helpers has been deprecated and will be removed in a later release of ckan. helpers.get_action() is deprecated and will be removed in a future version of CKAN. Instead, please use the extra_vars param to render() in your controller to pass results from action functions to your templates.
[Mon Aug 10 19:08:27.080089 2015] [:error] [pid 1243] 2015-08-10 19:08:27,079 WARNI [ckan.lib.maintain] Function get_action() in module ckan.lib.helpers has been deprecated and will be removed in a later release of ckan. helpers.get_action() is deprecated and will be removed in a future version of CKAN. Instead, please use the extra_vars param to render() in your controller to pass results from action functions to your templates.
[Mon Aug 10 19:08:27.190495 2015] [:error] [pid 1243] 2015-08-10 19:08:27,190 INFO [ckan.lib.base] /dataset/grocery-prices render time 0.551 seconds
[Mon Aug 10 19:08:27.664450 2015] [:error] [pid 1244] 2015-08-10 19:08:27,664 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:30.847326 2015] [:error] [pid 1243] 2015-08-10 19:08:30,847 INFO [ckan.lib.base] /dataset/edit/grocery-prices render time 0.405 seconds
[Mon Aug 10 19:08:31.373743 2015] [:error] [pid 1244] 2015-08-10 19:08:31,373 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:34.934102 2015] [:error] [pid 1243] 2015-08-10 19:08:34,933 INFO [ckan.lib.base] /dataset/new render time 0.091 seconds
[Mon Aug 10 19:08:35.451324 2015] [:error] [pid 1244] 2015-08-10 19:08:35,451 INFO [ckan.lib.base] /dataset/new_resource/grocery-prices render time 0.412 seconds
[Mon Aug 10 19:08:36.271926 2015] [:error] [pid 1244] 2015-08-10 19:08:36,271 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:49.310932 2015] [:error] [pid 1244] 2015-08-10 19:08:49,310 INFO [ckan.lib.base] /api/2/util/resource/format_autocomplete render time 0.006 seconds
[Mon Aug 10 19:09:11.244287 2015] [:error] [pid 1243] /usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py:79: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead.
[Mon Aug 10 19:09:11.244325 2015] [:error] [pid 1243] sess._flush_warning("related attribute set")
[Mon Aug 10 19:09:11.518274 2015] [:error] [pid 1243] 2015-08-10 19:09:11,518 INFO [ckan.lib.base] /dataset/new_resource/grocery-prices render time 0.176 seconds
[Mon Aug 10 19:09:11.975593 2015] [:error] [pid 1244] 2015-08-10 19:09:11,975 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
Not sure what caused this error and the logs do not provide enough information. The file is not deposited to the dataset directory location.
Using CKAN 2.3 on a Ubuntu 14.04 server running apache2

Continuous integration with Xcode Bots

I want to to do the continuous integration using Xcode bots. I have installed OSX Mavericks and Server(version 3). I am able to create bots using Xcode 5.0.1. While integrating it is successfully performing analyzing testing but always the final integration result is failure.
Integration failed. Unexpected internal server error. See the integration's logs for more details.`
I didnt understand anything from the server error logs.Its failing due to some wiki service related errors.
Can anyone help me?
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:233 7e026310 +0ms] didReceiveData
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:246 7e026310 +2ms] connectionDidFinishLoading
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:172 7e026310 +0ms] Out of runloop; request completed
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceProxy.m:79 7e026310 +0ms] Received successful response.
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:97 7e026310 +0ms] Updating bot run with GUID fc16d3af-093e-44aa-8a40-ebfef45bbbd9
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:102 7e026310 +0ms] Updating bot run (fc16d3af-093e-44aa-8a40-ebfef45bbbd9): {
guid = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
status = failed;
subStatus = "internal-error";
}
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSRemoteServiceClient.m:151 7e026310 +0ms] Connecting to https://localhost:4443/svc to execute [https]Request{XCBotService.updateBotRun:({
guid = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
status = failed;
subStatus = "internal-error";
})}
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:159 7e026310 +0ms] Secure, async request
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:169 7e026310 +0ms] Before runloop; request pending
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:223 7e026310 +157ms] didReceiveResponse
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:225 7e026310 +0ms] response=<NSHTTPURLResponse: 0x7fd24a5a7980> { URL: https://localhost:4443/svc } { status code: 200, headers {
"Accept-Ranges" = bytes;
"Content-Length" = 3700;
"Content-Type" = "x-apple/msgpack";
Date = "Tue, 29 Oct 2013 04:48:41 GMT";
Status = 200;
"X-Apple-collabd" = yes;
} }
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:233 7e026310 +0ms] didReceiveData
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:246 7e026310 +0ms] connectionDidFinishLoading
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:172 7e026310 +0ms] Out of runloop; request completed
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceProxy.m:79 7e026310 +0ms] Received successful response.
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:108 7e026310 +0ms] Updating bot with GUID 4e122aa2-56dd-4e3a-ad6e-25be1a65e657
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:117 7e026310 +0ms] Updating bot with latest bot run GUID key
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [XCSBuildHelper.m:124 7e026310 +0ms] Updating bot (4e122aa2-56dd-4e3a-ad6e-25be1a65e657): {
guid = "4e122aa2-56dd-4e3a-ad6e-25be1a65e657";
latestFailedBotRunGUID = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
latestRunStatus = failed;
latestRunSubStatus = "internal-error";
}
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSConfig.m:55 7e026310 +0ms] Reading plist at /Library/Server/Wiki/Config/collabd.plist
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Info>: [CSRemoteServiceClient.m:151 7e026310 +0ms] Connecting to https://localhost:4443/svc to execute [https]Request{XCBotService.updateBot:({
guid = "4e122aa2-56dd-4e3a-ad6e-25be1a65e657";
latestFailedBotRunGUID = "fc16d3af-093e-44aa-8a40-ebfef45bbbd9";
latestRunStatus = failed;
latestRunSubStatus = "internal-error";
})}
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:159 7e026310 +0ms] Secure, async request
Oct 29 10:18:41 AnilV-InetliMac.local xcsbuildd[11285] <Debug>: [CSRemoteServiceClient.m:169 7e026310 +0ms] Before runloop; request pending
The problem seems to be that XCode5 Bots do not know how to use pure svn. You have to use svn+ssh.
[UPDATE] You could also use git ... synchronized with your SVN. The workflow ist slightly different, but it works great.
I found this today: subgit
It perfectly integrates into GIT and SVN, you can set up GIT repositories in Xcode Server and upgrade them with subgit - they will both stay in sync. (took me about half an hour to completely understand how it works)
Best of all: a 10 seat license (meaning 10 collaborator via subgit) is totally free (and quite enough for my use case).
[PREVIOUS ANSWER] I made a simple solution that involves an SSH Server on the SVN Server machine. I think it does not matter which one, but I'm currently using Cygwin.
In the /etc/sshd_config you need to add a subsystem
Subsystem "svnserve -t" /etc/svnserve-proxy
You need to create the file /etc/svnserve-proxy
cat > /etc/svnserve-proxy
#!/bin/bash
svnserve -t -r <repository>
You have to modify the svnserve command and repository respectively.
On your local computer you have to modify the file ~/.subversion/config and add a [tunnels] line:
[tunnels]
ssh = $SVN_SSH ssh -v -l <username> -s
username is the name of the user you want to authenticate with.
This solution is quick and dirty and does not allow for different users to authenticate. In addition, Xcode needs to use the same username on your local machine and the Bot-Server. It is quite possible that you have to create a _teamsuser home directory and put an subversion/config in there as well.
An alternative would be to use public-keys (As the bot server already creates) You can then put these into authorized_keys and put a command in front:
command="svnserve -t -r <repository> --tunnel-user=<user>" rsa-ssh AAA
I had a similar problem. In my case it was issue accessing the source code repository. The OSX Server had DNS issue which was preventing it from reaching the host. Can you check if you are able to access your source code repository?
With Xcode 9 apple brings ease to continuous integration with Xcode bots.
Xcode Server built-in. Continuous integration bots can be run on any Mac with Xcode 9, no need to install macOS Server.
I found very good article explaining how to configure it with Xcode 9.
Xcode9 - Xcode server comprehensive iOS continuous integration

ActiveRecord does not respect daylight saving time (DST)?

We're in the timezone Bern, which is +0100. But since we're now in summertime (we have daylight saving time), the current offset is +0200. In my rails app, I set the timezone using a wrapper in the application controller since I need to have user-based timezones:
around_filter :user_timezone
def user_timezone(&block)
Time.use_zone(current_timezone, &block)
end
Now the strange part:
Time.zone.now # 2013-04-10 10:32:56 +0200
# (correct offset)
SomeArModel.first.created_at # 2013-03-28 17:49:59 +0100
# (incorrect offset, no DST)
Is there any explanation for this?
Thats normal behavior, the DST change happened on Sun Mar 31 01:00:00 UTC 2013.
t = Time.mktime(2013, 03, 31, 1, 15, 0)
6.times do
t += 900
u = Time.at(t.to_i).utc
puts t.to_s + " " + u.to_s
end
output:
Sun Mar 31 01:30:00 +0100 2013 Sun Mar 31 00:30:00 UTC 2013
Sun Mar 31 01:45:00 +0100 2013 Sun Mar 31 00:45:00 UTC 2013
Sun Mar 31 03:00:00 +0200 2013 Sun Mar 31 01:00:00 UTC 2013
Sun Mar 31 03:15:00 +0200 2013 Sun Mar 31 01:15:00 UTC 2013
Sun Mar 31 03:30:00 +0200 2013 Sun Mar 31 01:30:00 UTC 2013
Sun Mar 31 03:45:00 +0200 2013 Sun Mar 31 01:45:00 UTC 2013

Connection error using Rails 3.0 and Mongo 1.4.0

I created a library that would record events to MongoDB from my Rails application. I'm using version 1.4.0 of the mongo gem and Rails 3.0 w/Ruby 1.8.7. The relevant code is:
def new_event(collection, event)
#conn = Mongo::Connection.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
#conn.db("event").collection(collection).insert(event)
#conn.close
end
This has worked fine for recording new events as they happen on the site. However, I also need to backfill the db with old events. So I'm doing running a script that basically does this:
SomeModel.find_each do |model|
Tracker.new.new_event("model_event", { ... info from model ... })
end
I'm trying to backfill something on the order of 50k events. As the script runs, I see this:
Tue Sep 27 23:45:20 [initandlisten] waiting for connections on port 27017
Tue Sep 27 23:46:20 [clientcursormon] mem (MB) res:12 virt:78 mapped:0
Tue Sep 27 23:48:49 [initandlisten] connection accepted from 127.0.0.1:51006 #1
Tue Sep 27 23:49:03 [conn1] remove event.application 103ms
Tue Sep 27 23:49:12 [conn1] remove event.listing 127ms
Tue Sep 27 23:49:20 [clientcursormon] mem (MB) res:37 virt:207 mapped:128
Tue Sep 27 23:51:44 [initandlisten] connection accepted from 127.0.0.1:48103 #2
Tue Sep 27 23:51:44 [conn2] end connection 127.0.0.1:48103
Tue Sep 27 23:51:44 [initandlisten] connection accepted from 127.0.0.1:48104 #3
Tue Sep 27 23:51:44 [conn3] end connection 127.0.0.1:48104
Tue Sep 27 23:51:44 [initandlisten] connection accepted from 127.0.0.1:48105 #4
Tue Sep 27 23:51:44 [conn4] end connection 127.0.0.1:48105
Tue Sep 27 23:51:44 [initandlisten] connection accepted from 127.0.0.1:48106 #5
Tue Sep 27 23:51:44 [conn5] end connection 127.0.0.1:48106
The ports (127.0.0.1:XXXXX) and (what I assume are) the Connection Pool #s keep incrementing, until eventually I get this exception from the ruby script:
Failed to connect to a master node at localhost:27017
/var/bundler/turtle/ruby/1.8/gems/mongo-1.4.0/lib/../lib/mongo/connection.rb:526:in `connect'
/var/bundler/turtle/ruby/1.8/gems/mongo-1.4.0/lib/../lib/mongo/connection.rb:688:in `setup'
/var/bundler/turtle/ruby/1.8/gems/mongo-1.4.0/lib/../lib/mongo/connection.rb:104:in `initialize'
Just found the solution. I needed to make the connection object a class variable so it was shared across all instances of the Tracker class.
##conn = Mongo::Connection.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
def self.new_event(collection, event)
##conn.db("event").collection(collection).insert(event)
end

Resources